Remove nova.config.CONF

Modules import nova.config for two reasons right now - firstly, to
reference nova.config.CONF and, secondly, if they use one of the
options defined in nova.config.

Often modules import nova.openstack.common.cfg and nova.config
which is a bit pointless since they could just use cfg.CONF if
they just want to nova.config in order to reference CONF.

Let's just use cfg.CONF everywhere and we can explicitly state
where we actually require options defined in nova.config.

Change-Id: Ie4184a74e3e78c99658becb18dce1c2087e450bb
This commit is contained in:
Mark McLoughlin
2012-11-17 22:50:17 +00:00
parent ae34a772b3
commit 1573b2794c
35 changed files with 52 additions and 44 deletions

View File

@@ -42,13 +42,14 @@ if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
from nova import config
from nova.objectstore import s3server
from nova.openstack.common import cfg
from nova.openstack.common import log as logging
from nova import service
from nova import utils
from nova.vnc import xvp_proxy
CONF = config.CONF
CONF = cfg.CONF
LOG = logging.getLogger('nova.all')
if __name__ == '__main__':

View File

@@ -37,11 +37,12 @@ if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
from nova import config
from nova.openstack.common import cfg
from nova.openstack.common import log as logging
from nova import service
from nova import utils
CONF = config.CONF
CONF = cfg.CONF
if __name__ == '__main__':
config.parse_args(sys.argv)

View File

@@ -33,11 +33,12 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
from nova import config
from nova.openstack.common import cfg
from nova.openstack.common import log as logging
from nova import service
from nova import utils
CONF = config.CONF
CONF = cfg.CONF
if __name__ == '__main__':
config.parse_args(sys.argv)

View File

@@ -52,7 +52,7 @@ delete_exchange_opt = cfg.BoolOpt('delete_exchange',
default=False,
help='delete nova exchange too.')
CONF = config.CONF
CONF = cfg.CONF
CONF.register_cli_opt(delete_exchange_opt)

View File

@@ -42,11 +42,12 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
from nova import config
from nova.openstack.common import cfg
from nova.openstack.common import log as logging
from nova import service
from nova import utils
CONF = config.CONF
CONF = cfg.CONF
if __name__ == '__main__':
config.parse_args(sys.argv)

View File

@@ -33,11 +33,12 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
from nova import config
from nova.openstack.common import cfg
from nova.openstack.common import log as logging
from nova import service
from nova import utils
CONF = config.CONF
CONF = cfg.CONF
CONF.import_opt('topic', 'nova.conductor.api', group='conductor')
if __name__ == '__main__':

View File

@@ -34,10 +34,11 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
from nova import config
from nova.openstack.common import cfg
from nova.openstack.common import log as logging
from nova import service
CONF = config.CONF
CONF = cfg.CONF
if __name__ == '__main__':
config.parse_args(sys.argv)

View File

@@ -33,10 +33,11 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
from nova import config
from nova.consoleauth import manager
from nova.openstack.common import cfg
from nova.openstack.common import log as logging
from nova import service
CONF = config.CONF
CONF = cfg.CONF
if __name__ == "__main__":
config.parse_args(sys.argv)

View File

@@ -40,12 +40,13 @@ from nova import context
from nova import db
from nova.network import linux_net
from nova.network import rpcapi as network_rpcapi
from nova.openstack.common import cfg
from nova.openstack.common import importutils
from nova.openstack.common import log as logging
from nova.openstack.common import rpc
from nova import utils
CONF = config.CONF
CONF = cfg.CONF
LOG = logging.getLogger('nova.dhcpbridge')

View File

@@ -88,7 +88,7 @@ from nova.scheduler import rpcapi as scheduler_rpcapi
from nova import utils
from nova import version
CONF = config.CONF
CONF = cfg.CONF
CONF.import_opt('flat_network_bridge', 'nova.network.manager')
CONF.import_opt('num_networks', 'nova.network.manager')
CONF.import_opt('multi_host', 'nova.network.manager')

View File

@@ -35,11 +35,12 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
from nova import config
from nova.openstack.common import cfg
from nova.openstack.common import log as logging
from nova import service
from nova import utils
CONF = config.CONF
CONF = cfg.CONF
if __name__ == '__main__':
config.parse_args(sys.argv)

View File

@@ -67,7 +67,7 @@ opts = [
help='Port on which to listen for incoming requests'),
]
CONF = config.CONF
CONF = cfg.CONF
CONF.register_cli_opts(opts)
LOG = logging.getLogger(__name__)

View File

@@ -34,12 +34,13 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
from nova import config
from nova import exception
from nova.openstack.common import cfg
from nova.openstack.common import log as logging
from nova.openstack.common import rpc
from nova.openstack.common.rpc import impl_zmq
from nova import utils
CONF = config.CONF
CONF = cfg.CONF
CONF.register_opts(rpc.rpc_opts)
CONF.register_opts(impl_zmq.zmq_opts)

View File

@@ -37,11 +37,12 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
gettext.install('nova', unicode=1)
from nova import config
from nova.openstack.common import cfg
from nova.openstack.common import log as logging
from nova import service
from nova import utils
CONF = config.CONF
CONF = cfg.CONF
if __name__ == '__main__':
config.parse_args(sys.argv)