~rlane/nova/lp773690

« back to all changes in this revision

Viewing changes to nova/console/manager.py

  • Committer: rlane at wikimedia
  • Date: 2011-04-29 22:30:40 UTC
  • mfrom: (382.1.655 nova)
  • Revision ID: rlane@wikimedia.org-20110429223040-i0x3ds9eqwrabyru
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#    License for the specific language governing permissions and limitations
16
16
#    under the License.
17
17
 
18
 
"""
19
 
Console Proxy Service
20
 
"""
 
18
"""Console Proxy Service."""
21
19
 
22
20
import functools
23
21
import socket
29
27
from nova import rpc
30
28
from nova import utils
31
29
 
 
30
 
32
31
FLAGS = flags.FLAGS
33
32
flags.DEFINE_string('console_driver',
34
33
                    'nova.console.xvp.XVPConsoleProxy',
41
40
 
42
41
 
43
42
class ConsoleProxyManager(manager.Manager):
44
 
 
45
 
    """ Sets up and tears down any proxy connections needed for accessing
46
 
        instance consoles securely"""
 
43
    """Sets up and tears down any console proxy connections.
 
44
 
 
45
    Needed for accessing instance consoles securely.
 
46
 
 
47
    """
47
48
 
48
49
    def __init__(self, console_driver=None, *args, **kwargs):
49
50
        if not console_driver:
67
68
                                                      pool['id'],
68
69
                                                      instance_id)
69
70
        except exception.NotFound:
70
 
            logging.debug(_("Adding console"))
 
71
            logging.debug(_('Adding console'))
71
72
            if not password:
72
73
                password = utils.generate_password(8)
73
74
            if not port:
115
116
                                 self.db.queue_get_for(context,
116
117
                                                   FLAGS.compute_topic,
117
118
                                                   instance_host),
118
 
                       {"method": "get_console_pool_info",
119
 
                        "args": {"console_type": console_type}})
 
119
                       {'method': 'get_console_pool_info',
 
120
                        'args': {'console_type': console_type}})
120
121
            pool_info['password'] = self.driver.fix_pool_password(
121
122
                                                    pool_info['password'])
122
123
            pool_info['host'] = self.host