Use CONF.import_opt() for nova.config opts

The only reason for importing nova.config now is where one of the
options defined in that file is needed. Rather than importing
nova.config using an import statement, use CONF.import_opt() so
that it is clear which option we actually require.

In future, we will move many options out of nova.config so many
of these import_opt() calls will either go away or cause a module
other than nova.config to be imported.

Change-Id: I0646efddecdf2530903afd50c1f4364cb1d5dce1
This commit is contained in:
Mark McLoughlin
2012-11-17 22:50:21 +00:00
parent 57e2a0370c
commit 6779401232
2 changed files with 1 additions and 2 deletions

View File

@@ -25,7 +25,6 @@ POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'nova', '__init__.py')):
sys.path.insert(0, POSSIBLE_TOPDIR)
from nova import config
from nova import config
from nova.openstack.common import cfg
from nova.openstack.common import log as logging

View File

@@ -27,7 +27,6 @@ if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
sys.path.insert(0, possible_topdir)
from nova import config
from nova import context
from nova import db
from nova import exception
@@ -37,6 +36,7 @@ from nova.virt.xenapi import driver as xenapi_driver
CONF = cfg.CONF
CONF.import_opt('zombie_instance_updated_at_window', 'nova.config')
CONF.import_opt("resize_confirm_window", "nova.compute.manager")