diff options
author | Mark McLoughlin <markmc@redhat.com> | 2012-11-21 22:44:23 +0000 |
---|---|---|
committer | Mark McLoughlin <markmc@redhat.com> | 2012-11-21 22:44:23 +0000 |
commit | ac1c637522d9d9fe44e82b02ad1eb23430cc631b (patch) | |
tree | 776c66d5ddaccef6e924fb8a2457b8a1bd9c8ac2 /nova/block_device.py | |
parent | 0e11414307e1c5fdbfece7e59244a8b359944a26 (diff) | |
download | nova-ac1c637522d9d9fe44e82b02ad1eb23430cc631b.tar.gz nova-ac1c637522d9d9fe44e82b02ad1eb23430cc631b.tar.xz nova-ac1c637522d9d9fe44e82b02ad1eb23430cc631b.zip |
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
Diffstat (limited to 'nova/block_device.py')
-rw-r--r-- | nova/block_device.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/nova/block_device.py b/nova/block_device.py index a3c28d3ed..ea4ff9c3b 100644 --- a/nova/block_device.py +++ b/nova/block_device.py @@ -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 |