Switch from FLAGS to CONF in misc modules

Use the global CONF variable instead of FLAGS. This is purely a cleanup
since FLAGS is already just another reference to CONF.

We leave the nova.flags imports until a later cleanup commit since
removing them may cause unpredictable problems due to config options not
being registered.

Change-Id: Ib110ba8d1837780e90b0d3fe13f8e6b68ed15f65
This commit is contained in:
Mark McLoughlin
2012-11-04 21:32:45 +00:00
parent 8ce58defbe
commit 637e805634
28 changed files with 231 additions and 216 deletions

View File

@@ -17,9 +17,10 @@
import re
from nova import config
from nova import flags
FLAGS = flags.FLAGS
CONF = config.CONF
DEFAULT_ROOT_DEV_NAME = '/dev/sda1'
_DEFAULT_MAPPINGS = {'ami': 'sda1',
@@ -94,7 +95,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 FLAGS.compute_driver.endswith('xenapi.XenAPIDriver'):
if CONF.compute_driver.endswith('xenapi.XenAPIDriver'):
root_device_name = '/dev/xvda'
else:
return _DEFAULT_MAPPINGS