summaryrefslogtreecommitdiff
path: root/nova/consoleauth/manager.py
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2012-11-04 21:32:45 +0000
committerMark McLoughlin <markmc@redhat.com>2012-11-04 21:46:35 +0000
commit637e805634b5179ffacad57ee26d4175449537f5 (patch)
treec0ff2f32d3f2957ae7b96a2eedc35b0029917048 /nova/consoleauth/manager.py
parent8ce58defbe560b1da34d991b38ac64a9b4c8d654 (diff)
downloadnova-637e805634b5179ffacad57ee26d4175449537f5.tar.gz
Switch from FLAGS to CONF in misc modules
Use the global CONF variable instead of FLAGS. This is purely a cleanup since FLAGS is already just another reference to CONF. We leave the nova.flags imports until a later cleanup commit since removing them may cause unpredictable problems due to config options not being registered. Change-Id: Ib110ba8d1837780e90b0d3fe13f8e6b68ed15f65
Diffstat (limited to 'nova/consoleauth/manager.py')
-rw-r--r--nova/consoleauth/manager.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/nova/consoleauth/manager.py b/nova/consoleauth/manager.py
index c78554c870..c772101ebe 100644
--- a/nova/consoleauth/manager.py
+++ b/nova/consoleauth/manager.py
@@ -20,6 +20,7 @@
import time
+from nova import config
from nova import flags
from nova import manager
from nova.openstack.common import cfg
@@ -38,8 +39,8 @@ consoleauth_opts = [
help='Manager for console auth'),
]
-FLAGS = flags.FLAGS
-FLAGS.register_opts(consoleauth_opts)
+CONF = config.CONF
+CONF.register_opts(consoleauth_opts)
class ConsoleAuthManager(manager.Manager):
@@ -50,11 +51,11 @@ class ConsoleAuthManager(manager.Manager):
def __init__(self, scheduler_driver=None, *args, **kwargs):
super(ConsoleAuthManager, self).__init__(*args, **kwargs)
- if FLAGS.memcached_servers:
+ if CONF.memcached_servers:
import memcache
else:
from nova.common import memorycache as memcache
- self.mc = memcache.Client(FLAGS.memcached_servers,
+ self.mc = memcache.Client(CONF.memcached_servers,
debug=0)
def authorize_console(self, context, token, console_type, host, port,
@@ -66,7 +67,7 @@ class ConsoleAuthManager(manager.Manager):
'internal_access_path': internal_access_path,
'last_activity_at': time.time()}
data = jsonutils.dumps(token_dict)
- self.mc.set(token, data, FLAGS.console_token_ttl)
+ self.mc.set(token, data, CONF.console_token_ttl)
LOG.audit(_("Received Token: %(token)s, %(token_dict)s)"), locals())
def check_token(self, context, token):