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
This commit is contained in:
Mark McLoughlin
2012-11-04 21:32:45 +00:00
parent 45af1f23a4
commit f7bf85b5a9
10 changed files with 86 additions and 80 deletions

View File

@@ -55,6 +55,7 @@ This module provides Manager, a base class for managers.
import eventlet
from nova import config
from nova.db import base
from nova import flags
from nova.openstack.common import log as logging
@@ -63,10 +64,7 @@ from nova.openstack.common.rpc import dispatcher as rpc_dispatcher
from nova.scheduler import rpcapi as scheduler_rpcapi
from nova import version
FLAGS = flags.FLAGS
CONF = config.CONF
LOG = logging.getLogger(__name__)
@@ -139,7 +137,7 @@ class Manager(base.Base):
def __init__(self, host=None, db_driver=None):
if not host:
host = FLAGS.host
host = CONF.host
self.host = host
self.load_plugins()
super(Manager, self).__init__(db_driver)
@@ -215,8 +213,8 @@ class Manager(base.Base):
def service_config(self, context):
config = {}
for key in FLAGS:
config[key] = FLAGS.get(key, None)
for key in CONF:
config[key] = CONF.get(key, None)
return config