Move compute_driver into nova.virt.driver
Commit 9102f80 moved compute_driver from nova.compute.manager into nova.config. We're trying to get away from so many global options, so where to put it? The config option is used for two things - loading the driver and, in a bunch of random places, checking if it matches a specific value. It seems to make perfect to sense to encapsulate both as functions in nova.virt.driver and move the option there. blueprint: scope-config-opts Change-Id: I28a71df5b682c6bd381401f63da49d91fb187125
This commit is contained in:
parent
d121d7573c
commit
a654e324ed
@ -17,10 +17,7 @@
|
||||
|
||||
import re
|
||||
|
||||
from nova.openstack.common import cfg
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('compute_driver', 'nova.config')
|
||||
from nova.virt import driver
|
||||
|
||||
DEFAULT_ROOT_DEV_NAME = '/dev/sda1'
|
||||
_DEFAULT_MAPPINGS = {'ami': 'sda1',
|
||||
@ -95,7 +92,7 @@ def instance_block_mapping(instance, bdms):
|
||||
root_device_name = instance['root_device_name']
|
||||
# NOTE(clayg): remove this when xenapi is setting default_root_device
|
||||
if root_device_name is None:
|
||||
if CONF.compute_driver.endswith('xenapi.XenAPIDriver'):
|
||||
if driver.compute_driver_matches('xenapi.XenAPIDriver'):
|
||||
root_device_name = '/dev/xvda'
|
||||
else:
|
||||
return _DEFAULT_MAPPINGS
|
||||
|
@ -20,12 +20,12 @@ from nova.openstack.common import cfg
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('state_path', 'nova.config')
|
||||
|
||||
CONF.import_opt('scheduler_driver', 'nova.scheduler.manager')
|
||||
CONF.import_opt('fake_network', 'nova.network.manager')
|
||||
CONF.import_opt('network_size', 'nova.network.manager')
|
||||
CONF.import_opt('num_networks', 'nova.network.manager')
|
||||
CONF.import_opt('policy_file', 'nova.policy')
|
||||
CONF.import_opt('compute_driver', 'nova.virt.driver')
|
||||
|
||||
|
||||
def set_defaults(conf):
|
||||
|
@ -58,6 +58,7 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('compute_manager', 'nova.config')
|
||||
CONF.import_opt('compute_driver', 'nova.virt.driver')
|
||||
CONF.import_opt('host', 'nova.config')
|
||||
CONF.import_opt('network_manager', 'nova.config')
|
||||
CONF.import_opt('node_availability_zone', 'nova.config')
|
||||
|
Loading…
Reference in New Issue
Block a user