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 94d87bce21
commit e237c86446
109 changed files with 201 additions and 103 deletions

View File

@@ -29,7 +29,6 @@ from nova.compute import instance_types
from nova.compute import power_state
from nova.compute import task_states
from nova.compute import vm_states
from nova import config
from nova import context
from nova import db
from nova import exception
@@ -58,6 +57,10 @@ from nova.virt.xenapi import volume_utils
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF.import_opt('compute_manager', 'nova.config')
CONF.import_opt('host', 'nova.config')
CONF.import_opt('network_manager', 'nova.config')
CONF.import_opt('node_availability_zone', 'nova.config')
IMAGE_MACHINE = '1'
IMAGE_KERNEL = '2'