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:
@@ -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__':
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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__':
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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__)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user