diff options
| author | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-03-17 18:54:16 -0700 |
|---|---|---|
| committer | Sandy Walsh <sandy.walsh@rackspace.com> | 2011-03-17 18:54:16 -0700 |
| commit | 23efe8d14973a7c94de167562340938ba00d043b (patch) | |
| tree | 4e383662f4d11763684901e454025ec9c9297543 /nova/console | |
| parent | 609a912fa8a816c1f47140489dcc1131356cd67c (diff) | |
| parent | abc6c82449dfc46a33dcd8190840e51f44b5b930 (diff) | |
| download | nova-23efe8d14973a7c94de167562340938ba00d043b.tar.gz nova-23efe8d14973a7c94de167562340938ba00d043b.tar.xz nova-23efe8d14973a7c94de167562340938ba00d043b.zip | |
refactored out middleware, now it's a decorator on service.api
Diffstat (limited to 'nova/console')
| -rw-r--r-- | nova/console/manager.py | 2 | ||||
| -rw-r--r-- | nova/console/xvp.py | 14 |
2 files changed, 6 insertions, 10 deletions
diff --git a/nova/console/manager.py b/nova/console/manager.py index 57c75cf4f..bfa571ea9 100644 --- a/nova/console/manager.py +++ b/nova/console/manager.py @@ -69,7 +69,7 @@ class ConsoleProxyManager(manager.Manager): except exception.NotFound: logging.debug(_("Adding console")) if not password: - password = self.driver.generate_password() + password = utils.generate_password(8) if not port: port = self.driver.get_port(context) console_data = {'instance_name': name, diff --git a/nova/console/xvp.py b/nova/console/xvp.py index cd257e0a6..0cedfbb13 100644 --- a/nova/console/xvp.py +++ b/nova/console/xvp.py @@ -91,10 +91,6 @@ class XVPConsoleProxy(object): """Trim password to length, and encode""" return self._xvp_encrypt(password) - def generate_password(self, length=8): - """Returns random console password""" - return os.urandom(length * 2).encode('base64')[:length] - def _rebuild_xvp_conf(self, context): logging.debug(_("Rebuilding xvp conf")) pools = [pool for pool in @@ -133,10 +129,10 @@ class XVPConsoleProxy(object): return logging.debug(_("Starting xvp")) try: - utils.execute('xvp -p %s -c %s -l %s' % - (FLAGS.console_xvp_pid, - FLAGS.console_xvp_conf, - FLAGS.console_xvp_log)) + utils.execute('xvp', + '-p', FLAGS.console_xvp_pid, + '-c', FLAGS.console_xvp_conf, + '-l', FLAGS.console_xvp_log) except exception.ProcessExecutionError, err: logging.error(_("Error starting xvp: %s") % err) @@ -190,5 +186,5 @@ class XVPConsoleProxy(object): flag = '-x' #xvp will blow up on passwords that are too long (mdragon) password = password[:maxlen] - out, err = utils.execute('xvp %s' % flag, process_input=password) + out, err = utils.execute('xvp', flag, process_input=password) return out.strip() |
