From 8b13b04c967d3c4951c6f7b39fdee61b897e9057 Mon Sep 17 00:00:00 2001 From: Alessandro Pilotti Date: Sun, 3 Mar 2013 00:12:21 +0200 Subject: [PATCH] Moves Hyper-V options to the hyperv section Fixes Bug: 1140778 Due to the large number of options available in Nova, in order to achieve better option organization and naming (e.g. avoid the hyperv_* prefix) and to avoid option name clashes, options specific to the Hyper-V driver are moved to a section named "hyperv". Backwards compatibility is mantained by providing the "deprecated_group" argument in option definitions. For case consistency the group name as been changed to "hyperv" for options introduced in Grizzly belonging to the group "HYPERV" Change-Id: If2710822cdf6e4ae108a6d1e7977735ac8104a2e --- nova/tests/test_hypervapi.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/nova/tests/test_hypervapi.py b/nova/tests/test_hypervapi.py index aaceff8e..3d23f84e 100644 --- a/nova/tests/test_hypervapi.py +++ b/nova/tests/test_hypervapi.py @@ -56,7 +56,7 @@ from nova.virt.hyperv import volumeutilsv2 from nova.virt import images CONF = cfg.CONF -CONF.import_opt('vswitch_name', 'nova.virt.hyperv.vif') +CONF.import_opt('vswitch_name', 'nova.virt.hyperv.vif', 'hyperv') class HyperVAPITestCase(test.TestCase): @@ -86,9 +86,11 @@ class HyperVAPITestCase(test.TestCase): self._setup_stubs() self.flags(instances_path=r'C:\Hyper-V\test\instances', - vswitch_name='external', - network_api_class='nova.network.quantumv2.api.API', - force_volumeutils_v1=True) + network_api_class='nova.network.quantumv2.api.API') + + self.flags(vswitch_name='external', + force_volumeutils_v1=True, + group='hyperv') self._conn = driver_hyperv.HyperVDriver(None) @@ -331,7 +333,7 @@ class HyperVAPITestCase(test.TestCase): cdb.__exit__(None, None, None).AndReturn(None) if not use_cdrom: - utils.execute(CONF.qemu_img_cmd, + utils.execute(CONF.hyperv.qemu_img_cmd, 'convert', '-f', 'raw', @@ -351,7 +353,7 @@ class HyperVAPITestCase(test.TestCase): def _test_spawn_config_drive(self, use_cdrom): self.flags(force_config_drive=True) - self.flags(config_drive_cdrom=use_cdrom) + self.flags(config_drive_cdrom=use_cdrom, group='hyperv') self.flags(mkisofs_cmd='mkisofs.exe') self._setup_spawn_config_drive_mocks(use_cdrom) @@ -391,7 +393,7 @@ class HyperVAPITestCase(test.TestCase): fake_vswitch_port = 'fake port' m = networkutils.NetworkUtils.get_external_vswitch( - CONF.vswitch_name) + CONF.hyperv.vswitch_name) m.AndReturn(fake_vswitch_path) m = networkutils.NetworkUtils.create_vswitch_port( @@ -410,7 +412,7 @@ class HyperVAPITestCase(test.TestCase): def setup_vif_mocks(): m = networkutils.NetworkUtils.get_external_vswitch( - CONF.vswitch_name) + CONF.hyperv.vswitch_name) m.AndRaise(vmutils.HyperVException(_('fake vswitch not found'))) self.assertRaises(vmutils.HyperVException, self._test_spawn_instance,