Merge "Switch from FLAGS to CONF in tests"
This commit is contained in:
		| @@ -29,10 +29,6 @@ from nova.tests import fake_utils | |||||||
| from nova.virt.baremetal import dom | from nova.virt.baremetal import dom | ||||||
| from nova.virt.baremetal import driver | from nova.virt.baremetal import driver | ||||||
|  |  | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS |  | ||||||
|  |  | ||||||
|  |  | ||||||
| # Same fake_domains is used by different classes, | # Same fake_domains is used by different classes, | ||||||
| # but different fake_file is used by different classes for unit test. | # but different fake_file is used by different classes for unit test. | ||||||
| fake_domains = [{'status': 1, 'name': 'instance-00000001', | fake_domains = [{'status': 1, 'name': 'instance-00000001', | ||||||
|   | |||||||
| @@ -16,8 +16,8 @@ | |||||||
| #    License for the specific language governing permissions and limitations | #    License for the specific language governing permissions and limitations | ||||||
| #    under the License. | #    under the License. | ||||||
|  |  | ||||||
| from nova import flags | from nova import config | ||||||
| from nova.openstack.common import cfg | from nova.openstack.common import cfg | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS | CONF = config.CONF | ||||||
| FLAGS.register_opt(cfg.IntOpt('answer', default=42, help='test flag')) | CONF.register_opt(cfg.IntOpt('answer', default=42, help='test flag')) | ||||||
|   | |||||||
| @@ -16,8 +16,8 @@ | |||||||
| #    License for the specific language governing permissions and limitations | #    License for the specific language governing permissions and limitations | ||||||
| #    under the License. | #    under the License. | ||||||
|  |  | ||||||
| from nova import flags | from nova import config | ||||||
| from nova.openstack.common import cfg | from nova.openstack.common import cfg | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS | CONF = config.CONF | ||||||
| FLAGS.register_opt(cfg.IntOpt('runtime_answer', default=54, help='test flag')) | CONF.register_opt(cfg.IntOpt('runtime_answer', default=54, help='test flag')) | ||||||
|   | |||||||
| @@ -18,14 +18,14 @@ | |||||||
| Unit Tests for nova.scheduler.rpcapi | Unit Tests for nova.scheduler.rpcapi | ||||||
| """ | """ | ||||||
|  |  | ||||||
|  | from nova import config | ||||||
| from nova import context | from nova import context | ||||||
| from nova import flags | from nova import flags | ||||||
| from nova.openstack.common import rpc | from nova.openstack.common import rpc | ||||||
| from nova.scheduler import rpcapi as scheduler_rpcapi | from nova.scheduler import rpcapi as scheduler_rpcapi | ||||||
| from nova import test | from nova import test | ||||||
|  |  | ||||||
|  | CONF = config.CONF | ||||||
| FLAGS = flags.FLAGS |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class SchedulerRpcAPITestCase(test.TestCase): | class SchedulerRpcAPITestCase(test.TestCase): | ||||||
| @@ -51,7 +51,7 @@ class SchedulerRpcAPITestCase(test.TestCase): | |||||||
|         retval = getattr(rpcapi, method)(ctxt, **kwargs) |         retval = getattr(rpcapi, method)(ctxt, **kwargs) | ||||||
|  |  | ||||||
|         self.assertEqual(retval, expected_retval) |         self.assertEqual(retval, expected_retval) | ||||||
|         expected_args = [ctxt, FLAGS.scheduler_topic, expected_msg] |         expected_args = [ctxt, CONF.scheduler_topic, expected_msg] | ||||||
|         for arg, expected_arg in zip(self.fake_args, expected_args): |         for arg, expected_arg in zip(self.fake_args, expected_args): | ||||||
|             self.assertEqual(arg, expected_arg) |             self.assertEqual(arg, expected_arg) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -43,9 +43,6 @@ from nova.openstack.common import timeutils | |||||||
| from nova import test | from nova import test | ||||||
|  |  | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class FakeHttplibSocket(object): | class FakeHttplibSocket(object): | ||||||
|     """a fake socket implementation for httplib.HTTPResponse, trivial""" |     """a fake socket implementation for httplib.HTTPResponse, trivial""" | ||||||
|     def __init__(self, response_string): |     def __init__(self, response_string): | ||||||
|   | |||||||
| @@ -30,8 +30,6 @@ from nova.openstack.common import timeutils | |||||||
| from nova import test | from nova import test | ||||||
| from nova import utils | from nova import utils | ||||||
|  |  | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS |  | ||||||
| CONF = config.CONF | CONF = config.CONF | ||||||
| CONF.import_opt('reserved_host_memory_mb', 'nova.compute.resource_tracker') | CONF.import_opt('reserved_host_memory_mb', 'nova.compute.resource_tracker') | ||||||
| CONF.import_opt('reserved_host_disk_mb', 'nova.compute.resource_tracker') | CONF.import_opt('reserved_host_disk_mb', 'nova.compute.resource_tracker') | ||||||
|   | |||||||
| @@ -23,8 +23,7 @@ from nova.openstack.common import cfg | |||||||
| from nova import test | from nova import test | ||||||
|  |  | ||||||
| CONF = config.CONF | CONF = config.CONF | ||||||
| FLAGS = flags.FLAGS | CONF.register_opt(cfg.StrOpt('flags_unittest', | ||||||
| FLAGS.register_opt(cfg.StrOpt('flags_unittest', |  | ||||||
|                               default='foo', |                               default='foo', | ||||||
|                               help='for testing purposes only')) |                               help='for testing purposes only')) | ||||||
|  |  | ||||||
| @@ -43,7 +42,7 @@ class FlagsTestCase(test.TestCase): | |||||||
|         self.assertEqual(CONF.answer, 256) |         self.assertEqual(CONF.answer, 256) | ||||||
|  |  | ||||||
|     def test_getopt_non_interspersed_args(self): |     def test_getopt_non_interspersed_args(self): | ||||||
|         self.assert_('runtime_answer' not in FLAGS) |         self.assert_('runtime_answer' not in CONF) | ||||||
|  |  | ||||||
|         argv = ['flags_test', 'extra_arg', '--runtime_answer=60'] |         argv = ['flags_test', 'extra_arg', '--runtime_answer=60'] | ||||||
|         args = config.parse_args(argv, default_config_files=[]) |         args = config.parse_args(argv, default_config_files=[]) | ||||||
| @@ -51,42 +50,42 @@ class FlagsTestCase(test.TestCase): | |||||||
|         self.assertEqual(argv, args) |         self.assertEqual(argv, args) | ||||||
|  |  | ||||||
|     def test_runtime_and_unknown_flags(self): |     def test_runtime_and_unknown_flags(self): | ||||||
|         self.assert_('runtime_answer' not in FLAGS) |         self.assert_('runtime_answer' not in CONF) | ||||||
|         import nova.tests.runtime_flags |         import nova.tests.runtime_flags | ||||||
|         self.assert_('runtime_answer' in FLAGS) |         self.assert_('runtime_answer' in CONF) | ||||||
|         self.assertEqual(FLAGS.runtime_answer, 54) |         self.assertEqual(CONF.runtime_answer, 54) | ||||||
|  |  | ||||||
|     def test_long_vs_short_flags(self): |     def test_long_vs_short_flags(self): | ||||||
|         FLAGS.clear() |         CONF.clear() | ||||||
|         FLAGS.register_cli_opt(cfg.StrOpt('duplicate_answer_long', |         CONF.register_cli_opt(cfg.StrOpt('duplicate_answer_long', | ||||||
|                                           default='val', |                                           default='val', | ||||||
|                                           help='desc')) |                                           help='desc')) | ||||||
|         argv = ['flags_test', '--duplicate_answer=60', 'extra_arg'] |         argv = ['flags_test', '--duplicate_answer=60', 'extra_arg'] | ||||||
|         args = config.parse_args(argv, default_config_files=[]) |         args = config.parse_args(argv, default_config_files=[]) | ||||||
|  |  | ||||||
|         self.assert_('duplicate_answer' not in FLAGS) |         self.assert_('duplicate_answer' not in CONF) | ||||||
|         self.assert_(FLAGS.duplicate_answer_long, 60) |         self.assert_(CONF.duplicate_answer_long, 60) | ||||||
|  |  | ||||||
|         FLAGS.clear() |         CONF.clear() | ||||||
|         FLAGS.register_cli_opt(cfg.IntOpt('duplicate_answer', |         CONF.register_cli_opt(cfg.IntOpt('duplicate_answer', | ||||||
|                                           default=60, help='desc')) |                                           default=60, help='desc')) | ||||||
|         args = config.parse_args(argv, default_config_files=[]) |         args = config.parse_args(argv, default_config_files=[]) | ||||||
|         self.assertEqual(FLAGS.duplicate_answer, 60) |         self.assertEqual(CONF.duplicate_answer, 60) | ||||||
|         self.assertEqual(FLAGS.duplicate_answer_long, 'val') |         self.assertEqual(CONF.duplicate_answer_long, 'val') | ||||||
|  |  | ||||||
|     def test_flag_leak_left(self): |     def test_flag_leak_left(self): | ||||||
|         self.assertEqual(FLAGS.flags_unittest, 'foo') |         self.assertEqual(CONF.flags_unittest, 'foo') | ||||||
|         self.flags(flags_unittest='bar') |         self.flags(flags_unittest='bar') | ||||||
|         self.assertEqual(FLAGS.flags_unittest, 'bar') |         self.assertEqual(CONF.flags_unittest, 'bar') | ||||||
|  |  | ||||||
|     def test_flag_leak_right(self): |     def test_flag_leak_right(self): | ||||||
|         self.assertEqual(FLAGS.flags_unittest, 'foo') |         self.assertEqual(CONF.flags_unittest, 'foo') | ||||||
|         self.flags(flags_unittest='bar') |         self.flags(flags_unittest='bar') | ||||||
|         self.assertEqual(FLAGS.flags_unittest, 'bar') |         self.assertEqual(CONF.flags_unittest, 'bar') | ||||||
|  |  | ||||||
|     def test_flag_overrides(self): |     def test_flag_overrides(self): | ||||||
|         self.assertEqual(FLAGS.flags_unittest, 'foo') |         self.assertEqual(CONF.flags_unittest, 'foo') | ||||||
|         self.flags(flags_unittest='bar') |         self.flags(flags_unittest='bar') | ||||||
|         self.assertEqual(FLAGS.flags_unittest, 'bar') |         self.assertEqual(CONF.flags_unittest, 'bar') | ||||||
|         FLAGS.reset() |         CONF.reset() | ||||||
|         self.assertEqual(FLAGS.flags_unittest, 'foo') |         self.assertEqual(CONF.flags_unittest, 'foo') | ||||||
|   | |||||||
| @@ -25,6 +25,7 @@ import sys | |||||||
| import uuid | import uuid | ||||||
|  |  | ||||||
| from nova.compute import power_state | from nova.compute import power_state | ||||||
|  | from nova import config | ||||||
| from nova import context | from nova import context | ||||||
| from nova import db | from nova import db | ||||||
| from nova import flags | from nova import flags | ||||||
| @@ -40,6 +41,8 @@ from nova.virt.hyperv import driver as driver_hyperv | |||||||
| from nova.virt.hyperv import vmutils | from nova.virt.hyperv import vmutils | ||||||
| from nova.virt import images | from nova.virt import images | ||||||
|  |  | ||||||
|  | CONF = config.CONF | ||||||
|  |  | ||||||
|  |  | ||||||
| class HyperVAPITestCase(basetestcase.BaseTestCase): | class HyperVAPITestCase(basetestcase.BaseTestCase): | ||||||
|     """Unit tests for Hyper-V driver calls.""" |     """Unit tests for Hyper-V driver calls.""" | ||||||
| @@ -148,7 +151,7 @@ class HyperVAPITestCase(basetestcase.BaseTestCase): | |||||||
|  |  | ||||||
|             self._hypervutils.logout_iscsi_volume_sessions(self._volume_id) |             self._hypervutils.logout_iscsi_volume_sessions(self._volume_id) | ||||||
|  |  | ||||||
|             shutil.rmtree(flags.FLAGS.instances_path, True) |             shutil.rmtree(CONF.instances_path, True) | ||||||
|  |  | ||||||
|             fake_image.FakeImageService_reset() |             fake_image.FakeImageService_reset() | ||||||
|         finally: |         finally: | ||||||
|   | |||||||
| @@ -17,13 +17,14 @@ | |||||||
|  |  | ||||||
| import os | import os | ||||||
|  |  | ||||||
|  | from nova import config | ||||||
| from nova import flags | from nova import flags | ||||||
| from nova.openstack.common import fileutils | from nova.openstack.common import fileutils | ||||||
| from nova import test | from nova import test | ||||||
| from nova.tests import fake_libvirt_utils | from nova.tests import fake_libvirt_utils | ||||||
| from nova.virt.libvirt import imagebackend | from nova.virt.libvirt import imagebackend | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS | CONF = config.CONF | ||||||
|  |  | ||||||
|  |  | ||||||
| class _ImageTestCase(test.TestCase): | class _ImageTestCase(test.TestCase): | ||||||
| @@ -42,9 +43,9 @@ class _ImageTestCase(test.TestCase): | |||||||
|         self.NAME = 'fake.vm' |         self.NAME = 'fake.vm' | ||||||
|         self.TEMPLATE = 'template' |         self.TEMPLATE = 'template' | ||||||
|  |  | ||||||
|         self.PATH = os.path.join(FLAGS.instances_path, self.INSTANCE, |         self.PATH = os.path.join(CONF.instances_path, self.INSTANCE, | ||||||
|                                  self.NAME) |                                  self.NAME) | ||||||
|         self.TEMPLATE_DIR = os.path.join(FLAGS.instances_path, |         self.TEMPLATE_DIR = os.path.join(CONF.instances_path, | ||||||
|                                          '_base') |                                          '_base') | ||||||
|         self.TEMPLATE_PATH = os.path.join(self.TEMPLATE_DIR, 'template') |         self.TEMPLATE_PATH = os.path.join(self.TEMPLATE_DIR, 'template') | ||||||
|  |  | ||||||
|   | |||||||
| @@ -27,6 +27,7 @@ from nova import test | |||||||
|  |  | ||||||
| from nova.compute import manager as compute_manager | from nova.compute import manager as compute_manager | ||||||
| from nova.compute import vm_states | from nova.compute import vm_states | ||||||
|  | from nova import config | ||||||
| from nova import db | from nova import db | ||||||
| from nova import flags | from nova import flags | ||||||
| from nova.openstack.common import importutils | from nova.openstack.common import importutils | ||||||
| @@ -35,8 +36,7 @@ from nova import utils | |||||||
| from nova.virt.libvirt import imagecache | from nova.virt.libvirt import imagecache | ||||||
| from nova.virt.libvirt import utils as virtutils | from nova.virt.libvirt import utils as virtutils | ||||||
|  |  | ||||||
|  | CONF = config.CONF | ||||||
| FLAGS = flags.FLAGS |  | ||||||
|  |  | ||||||
| LOG = log.getLogger(__name__) | LOG = log.getLogger(__name__) | ||||||
|  |  | ||||||
| @@ -147,13 +147,13 @@ class ImageCacheManagerTestCase(test.TestCase): | |||||||
|  |  | ||||||
|     def test_list_running_instances(self): |     def test_list_running_instances(self): | ||||||
|         all_instances = [{'image_ref': '1', |         all_instances = [{'image_ref': '1', | ||||||
|                           'host': FLAGS.host, |                           'host': CONF.host, | ||||||
|                           'name': 'inst-1', |                           'name': 'inst-1', | ||||||
|                           'uuid': '123', |                           'uuid': '123', | ||||||
|                           'vm_state': '', |                           'vm_state': '', | ||||||
|                           'task_state': ''}, |                           'task_state': ''}, | ||||||
|                          {'image_ref': '2', |                          {'image_ref': '2', | ||||||
|                           'host': FLAGS.host, |                           'host': CONF.host, | ||||||
|                           'name': 'inst-2', |                           'name': 'inst-2', | ||||||
|                           'uuid': '456', |                           'uuid': '456', | ||||||
|                           'vm_state': '', |                           'vm_state': '', | ||||||
| @@ -182,7 +182,7 @@ class ImageCacheManagerTestCase(test.TestCase): | |||||||
|  |  | ||||||
|     def test_list_resizing_instances(self): |     def test_list_resizing_instances(self): | ||||||
|         all_instances = [{'image_ref': '1', |         all_instances = [{'image_ref': '1', | ||||||
|                           'host': FLAGS.host, |                           'host': CONF.host, | ||||||
|                           'name': 'inst-1', |                           'name': 'inst-1', | ||||||
|                           'uuid': '123', |                           'uuid': '123', | ||||||
|                           'vm_state': vm_states.RESIZED, |                           'vm_state': vm_states.RESIZED, | ||||||
| @@ -209,7 +209,7 @@ class ImageCacheManagerTestCase(test.TestCase): | |||||||
|         self.stubs.Set(virtutils, 'get_disk_backing_file', |         self.stubs.Set(virtutils, 'get_disk_backing_file', | ||||||
|                        lambda x: 'e97222e91fc4241f49a7f520d1dcf446751129b3_sm') |                        lambda x: 'e97222e91fc4241f49a7f520d1dcf446751129b3_sm') | ||||||
|  |  | ||||||
|         found = os.path.join(FLAGS.instances_path, FLAGS.base_dir_name, |         found = os.path.join(CONF.instances_path, CONF.base_dir_name, | ||||||
|                              'e97222e91fc4241f49a7f520d1dcf446751129b3_sm') |                              'e97222e91fc4241f49a7f520d1dcf446751129b3_sm') | ||||||
|  |  | ||||||
|         image_cache_manager = imagecache.ImageCacheManager() |         image_cache_manager = imagecache.ImageCacheManager() | ||||||
| @@ -231,7 +231,7 @@ class ImageCacheManagerTestCase(test.TestCase): | |||||||
|                        lambda x: ('e97222e91fc4241f49a7f520d1dcf446751129b3_' |                        lambda x: ('e97222e91fc4241f49a7f520d1dcf446751129b3_' | ||||||
|                                   '10737418240')) |                                   '10737418240')) | ||||||
|  |  | ||||||
|         found = os.path.join(FLAGS.instances_path, FLAGS.base_dir_name, |         found = os.path.join(CONF.instances_path, CONF.base_dir_name, | ||||||
|                              'e97222e91fc4241f49a7f520d1dcf446751129b3_' |                              'e97222e91fc4241f49a7f520d1dcf446751129b3_' | ||||||
|                              '10737418240') |                              '10737418240') | ||||||
|  |  | ||||||
| @@ -252,7 +252,7 @@ class ImageCacheManagerTestCase(test.TestCase): | |||||||
|         self.stubs.Set(virtutils, 'get_disk_backing_file', |         self.stubs.Set(virtutils, 'get_disk_backing_file', | ||||||
|                        lambda x: 'e97222e91fc4241f49a7f520d1dcf446751129b3_sm') |                        lambda x: 'e97222e91fc4241f49a7f520d1dcf446751129b3_sm') | ||||||
|  |  | ||||||
|         found = os.path.join(FLAGS.instances_path, FLAGS.base_dir_name, |         found = os.path.join(CONF.instances_path, CONF.base_dir_name, | ||||||
|                              'e97222e91fc4241f49a7f520d1dcf446751129b3_sm') |                              'e97222e91fc4241f49a7f520d1dcf446751129b3_sm') | ||||||
|  |  | ||||||
|         image_cache_manager = imagecache.ImageCacheManager() |         image_cache_manager = imagecache.ImageCacheManager() | ||||||
| @@ -789,13 +789,13 @@ class ImageCacheManagerTestCase(test.TestCase): | |||||||
|  |  | ||||||
|         # Fake the database call which lists running instances |         # Fake the database call which lists running instances | ||||||
|         all_instances = [{'image_ref': '1', |         all_instances = [{'image_ref': '1', | ||||||
|                           'host': FLAGS.host, |                           'host': CONF.host, | ||||||
|                           'name': 'instance-1', |                           'name': 'instance-1', | ||||||
|                           'uuid': '123', |                           'uuid': '123', | ||||||
|                           'vm_state': '', |                           'vm_state': '', | ||||||
|                           'task_state': ''}, |                           'task_state': ''}, | ||||||
|                          {'image_ref': '1', |                          {'image_ref': '1', | ||||||
|                           'host': FLAGS.host, |                           'host': CONF.host, | ||||||
|                           'name': 'instance-2', |                           'name': 'instance-2', | ||||||
|                           'uuid': '456', |                           'uuid': '456', | ||||||
|                           'vm_state': '', |                           'vm_state': '', | ||||||
| @@ -868,11 +868,11 @@ class ImageCacheManagerTestCase(test.TestCase): | |||||||
|         self.flags(instances_path='/tmp/no/such/dir/name/please') |         self.flags(instances_path='/tmp/no/such/dir/name/please') | ||||||
|         self.flags(image_info_filename_pattern=('$instances_path/_base/' |         self.flags(image_info_filename_pattern=('$instances_path/_base/' | ||||||
|                                                 '%(image)s.info')) |                                                 '%(image)s.info')) | ||||||
|         base_filename = os.path.join(FLAGS.instances_path, '_base', hashed) |         base_filename = os.path.join(CONF.instances_path, '_base', hashed) | ||||||
|  |  | ||||||
|         self.assertFalse(virtutils.is_valid_info_file('banana')) |         self.assertFalse(virtutils.is_valid_info_file('banana')) | ||||||
|         self.assertFalse(virtutils.is_valid_info_file( |         self.assertFalse(virtutils.is_valid_info_file( | ||||||
|                 os.path.join(FLAGS.instances_path, '_base', '00000001'))) |                 os.path.join(CONF.instances_path, '_base', '00000001'))) | ||||||
|         self.assertFalse(virtutils.is_valid_info_file(base_filename)) |         self.assertFalse(virtutils.is_valid_info_file(base_filename)) | ||||||
|         self.assertFalse(virtutils.is_valid_info_file(base_filename + '.sha1')) |         self.assertFalse(virtutils.is_valid_info_file(base_filename + '.sha1')) | ||||||
|         self.assertTrue(virtutils.is_valid_info_file(base_filename + '.info')) |         self.assertTrue(virtutils.is_valid_info_file(base_filename + '.info')) | ||||||
| @@ -889,13 +889,13 @@ class ImageCacheManagerTestCase(test.TestCase): | |||||||
|  |  | ||||||
|             # Fake the database call which lists running instances |             # Fake the database call which lists running instances | ||||||
|             all_instances = [{'image_ref': '1', |             all_instances = [{'image_ref': '1', | ||||||
|                               'host': FLAGS.host, |                               'host': CONF.host, | ||||||
|                               'name': 'instance-1', |                               'name': 'instance-1', | ||||||
|                               'uuid': '123', |                               'uuid': '123', | ||||||
|                               'vm_state': '', |                               'vm_state': '', | ||||||
|                               'task_state': ''}, |                               'task_state': ''}, | ||||||
|                              {'image_ref': '1', |                              {'image_ref': '1', | ||||||
|                               'host': FLAGS.host, |                               'host': CONF.host, | ||||||
|                               'name': 'instance-2', |                               'name': 'instance-2', | ||||||
|                               'uuid': '456', |                               'uuid': '456', | ||||||
|                               'vm_state': '', |                               'vm_state': '', | ||||||
| @@ -927,19 +927,19 @@ class ImageCacheManagerTestCase(test.TestCase): | |||||||
|         def fake_get_all(context): |         def fake_get_all(context): | ||||||
|             was['called'] = True |             was['called'] = True | ||||||
|             return [{'image_ref': '1', |             return [{'image_ref': '1', | ||||||
|                      'host': FLAGS.host, |                      'host': CONF.host, | ||||||
|                      'name': 'instance-1', |                      'name': 'instance-1', | ||||||
|                      'uuid': '123', |                      'uuid': '123', | ||||||
|                      'vm_state': '', |                      'vm_state': '', | ||||||
|                      'task_state': ''}, |                      'task_state': ''}, | ||||||
|                     {'image_ref': '1', |                     {'image_ref': '1', | ||||||
|                      'host': FLAGS.host, |                      'host': CONF.host, | ||||||
|                      'name': 'instance-2', |                      'name': 'instance-2', | ||||||
|                      'uuid': '456', |                      'uuid': '456', | ||||||
|                      'vm_state': '', |                      'vm_state': '', | ||||||
|                      'task_state': ''}] |                      'task_state': ''}] | ||||||
|  |  | ||||||
|         self.stubs.Set(db, 'instance_get_all', fake_get_all) |         self.stubs.Set(db, 'instance_get_all', fake_get_all) | ||||||
|         compute = importutils.import_object(FLAGS.compute_manager) |         compute = importutils.import_object(CONF.compute_manager) | ||||||
|         compute._run_image_cache_manager_pass(None) |         compute._run_image_cache_manager_pass(None) | ||||||
|         self.assertTrue(was['called']) |         self.assertTrue(was['called']) | ||||||
|   | |||||||
| @@ -27,7 +27,6 @@ from nova import flags | |||||||
| from nova.openstack.common import log as logging | from nova.openstack.common import log as logging | ||||||
| from nova import test | from nova import test | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS |  | ||||||
| LOG = logging.getLogger(__name__) | LOG = logging.getLogger(__name__) | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -33,6 +33,7 @@ from nova.compute import instance_types | |||||||
| from nova.compute import power_state | from nova.compute import power_state | ||||||
| from nova.compute import vm_mode | from nova.compute import vm_mode | ||||||
| from nova.compute import vm_states | from nova.compute import vm_states | ||||||
|  | from nova import config | ||||||
| from nova import context | from nova import context | ||||||
| from nova import db | from nova import db | ||||||
| from nova import exception | from nova import exception | ||||||
| @@ -51,7 +52,7 @@ from nova.virt import driver | |||||||
| from nova.virt import fake | from nova.virt import fake | ||||||
| from nova.virt import firewall as base_firewall | from nova.virt import firewall as base_firewall | ||||||
| from nova.virt import images | from nova.virt import images | ||||||
| from nova.virt.libvirt import config | from nova.virt.libvirt import config as vconfig | ||||||
| from nova.virt.libvirt import driver as libvirt_driver | from nova.virt.libvirt import driver as libvirt_driver | ||||||
| from nova.virt.libvirt import firewall | from nova.virt.libvirt import firewall | ||||||
| from nova.virt.libvirt import imagebackend | from nova.virt.libvirt import imagebackend | ||||||
| @@ -69,7 +70,7 @@ except ImportError: | |||||||
| libvirt_driver.libvirt = libvirt | libvirt_driver.libvirt = libvirt | ||||||
|  |  | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS | CONF = config.CONF | ||||||
| LOG = logging.getLogger(__name__) | LOG = logging.getLogger(__name__) | ||||||
|  |  | ||||||
| _fake_network_info = fake_network.fake_get_instance_nw_info | _fake_network_info = fake_network.fake_get_instance_nw_info | ||||||
| @@ -267,7 +268,7 @@ class LibvirtVolumeTestCase(test.TestCase): | |||||||
|         tree = conf.format_dom() |         tree = conf.format_dom() | ||||||
|         self.assertEqual(tree.get('type'), 'network') |         self.assertEqual(tree.get('type'), 'network') | ||||||
|         self.assertEqual(tree.find('./source').get('protocol'), 'rbd') |         self.assertEqual(tree.find('./source').get('protocol'), 'rbd') | ||||||
|         rbd_name = '%s/%s' % (FLAGS.rbd_pool, name) |         rbd_name = '%s/%s' % (CONF.rbd_pool, name) | ||||||
|         self.assertEqual(tree.find('./source').get('name'), rbd_name) |         self.assertEqual(tree.find('./source').get('name'), rbd_name) | ||||||
|         self.assertEqual(tree.find('./source/auth'), None) |         self.assertEqual(tree.find('./source/auth'), None) | ||||||
|         libvirt_driver.disconnect_volume(connection_info, mount_device) |         libvirt_driver.disconnect_volume(connection_info, mount_device) | ||||||
| @@ -292,7 +293,7 @@ class LibvirtVolumeTestCase(test.TestCase): | |||||||
|         tree = conf.format_dom() |         tree = conf.format_dom() | ||||||
|         self.assertEqual(tree.get('type'), 'network') |         self.assertEqual(tree.get('type'), 'network') | ||||||
|         self.assertEqual(tree.find('./source').get('protocol'), 'rbd') |         self.assertEqual(tree.find('./source').get('protocol'), 'rbd') | ||||||
|         rbd_name = '%s/%s' % (FLAGS.rbd_pool, name) |         rbd_name = '%s/%s' % (CONF.rbd_pool, name) | ||||||
|         self.assertEqual(tree.find('./source').get('name'), rbd_name) |         self.assertEqual(tree.find('./source').get('name'), rbd_name) | ||||||
|         self.assertEqual(tree.find('./auth').get('username'), user) |         self.assertEqual(tree.find('./auth').get('username'), user) | ||||||
|         self.assertEqual(tree.find('./auth/secret').get('type'), secret_type) |         self.assertEqual(tree.find('./auth/secret').get('type'), secret_type) | ||||||
| @@ -324,7 +325,7 @@ class LibvirtVolumeTestCase(test.TestCase): | |||||||
|         tree = conf.format_dom() |         tree = conf.format_dom() | ||||||
|         self.assertEqual(tree.get('type'), 'network') |         self.assertEqual(tree.get('type'), 'network') | ||||||
|         self.assertEqual(tree.find('./source').get('protocol'), 'rbd') |         self.assertEqual(tree.find('./source').get('protocol'), 'rbd') | ||||||
|         rbd_name = '%s/%s' % (FLAGS.rbd_pool, name) |         rbd_name = '%s/%s' % (CONF.rbd_pool, name) | ||||||
|         self.assertEqual(tree.find('./source').get('name'), rbd_name) |         self.assertEqual(tree.find('./source').get('name'), rbd_name) | ||||||
|         self.assertEqual(tree.find('./auth').get('username'), flags_user) |         self.assertEqual(tree.find('./auth').get('username'), flags_user) | ||||||
|         self.assertEqual(tree.find('./auth/secret').get('type'), secret_type) |         self.assertEqual(tree.find('./auth/secret').get('type'), secret_type) | ||||||
| @@ -351,7 +352,7 @@ class LibvirtVolumeTestCase(test.TestCase): | |||||||
|         tree = conf.format_dom() |         tree = conf.format_dom() | ||||||
|         self.assertEqual(tree.get('type'), 'network') |         self.assertEqual(tree.get('type'), 'network') | ||||||
|         self.assertEqual(tree.find('./source').get('protocol'), 'rbd') |         self.assertEqual(tree.find('./source').get('protocol'), 'rbd') | ||||||
|         rbd_name = '%s/%s' % (FLAGS.rbd_pool, name) |         rbd_name = '%s/%s' % (CONF.rbd_pool, name) | ||||||
|         self.assertEqual(tree.find('./source').get('name'), rbd_name) |         self.assertEqual(tree.find('./source').get('name'), rbd_name) | ||||||
|         self.assertEqual(tree.find('./auth'), None) |         self.assertEqual(tree.find('./auth'), None) | ||||||
|         libvirt_driver.disconnect_volume(connection_info, mount_device) |         libvirt_driver.disconnect_volume(connection_info, mount_device) | ||||||
| @@ -383,7 +384,7 @@ class LibvirtVolumeTestCase(test.TestCase): | |||||||
|         tree = conf.format_dom() |         tree = conf.format_dom() | ||||||
|         self.assertEqual(tree.get('type'), 'network') |         self.assertEqual(tree.get('type'), 'network') | ||||||
|         self.assertEqual(tree.find('./source').get('protocol'), 'rbd') |         self.assertEqual(tree.find('./source').get('protocol'), 'rbd') | ||||||
|         rbd_name = '%s/%s' % (FLAGS.rbd_pool, name) |         rbd_name = '%s/%s' % (CONF.rbd_pool, name) | ||||||
|         self.assertEqual(tree.find('./source').get('name'), rbd_name) |         self.assertEqual(tree.find('./source').get('name'), rbd_name) | ||||||
|         self.assertEqual(tree.find('./auth').get('username'), flags_user) |         self.assertEqual(tree.find('./auth').get('username'), flags_user) | ||||||
|         self.assertEqual(tree.find('./auth/secret').get('type'), secret_type) |         self.assertEqual(tree.find('./auth/secret').get('type'), secret_type) | ||||||
| @@ -448,11 +449,11 @@ class CacheConcurrencyTestCase(test.TestCase): | |||||||
|         # which can cause race conditions with the multiple threads we |         # which can cause race conditions with the multiple threads we | ||||||
|         # use for tests. So, create the path here so utils.synchronized() |         # use for tests. So, create the path here so utils.synchronized() | ||||||
|         # won't delete it out from under one of the threads. |         # won't delete it out from under one of the threads. | ||||||
|         self.lock_path = os.path.join(FLAGS.instances_path, 'locks') |         self.lock_path = os.path.join(CONF.instances_path, 'locks') | ||||||
|         fileutils.ensure_tree(self.lock_path) |         fileutils.ensure_tree(self.lock_path) | ||||||
|  |  | ||||||
|         def fake_exists(fname): |         def fake_exists(fname): | ||||||
|             basedir = os.path.join(FLAGS.instances_path, FLAGS.base_dir_name) |             basedir = os.path.join(CONF.instances_path, CONF.base_dir_name) | ||||||
|             if fname == basedir or fname == self.lock_path: |             if fname == basedir or fname == self.lock_path: | ||||||
|                 return True |                 return True | ||||||
|             return False |             return False | ||||||
| @@ -647,28 +648,28 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|         self.assertEquals(cfg.os_root, None) |         self.assertEquals(cfg.os_root, None) | ||||||
|         self.assertEquals(len(cfg.devices), 7) |         self.assertEquals(len(cfg.devices), 7) | ||||||
|         self.assertEquals(type(cfg.devices[0]), |         self.assertEquals(type(cfg.devices[0]), | ||||||
|                           config.LibvirtConfigGuestDisk) |                           vconfig.LibvirtConfigGuestDisk) | ||||||
|         self.assertEquals(type(cfg.devices[1]), |         self.assertEquals(type(cfg.devices[1]), | ||||||
|                           config.LibvirtConfigGuestDisk) |                           vconfig.LibvirtConfigGuestDisk) | ||||||
|         self.assertEquals(type(cfg.devices[2]), |         self.assertEquals(type(cfg.devices[2]), | ||||||
|                           config.LibvirtConfigGuestInterface) |                           vconfig.LibvirtConfigGuestInterface) | ||||||
|         self.assertEquals(type(cfg.devices[3]), |         self.assertEquals(type(cfg.devices[3]), | ||||||
|                           config.LibvirtConfigGuestSerial) |                           vconfig.LibvirtConfigGuestSerial) | ||||||
|         self.assertEquals(type(cfg.devices[4]), |         self.assertEquals(type(cfg.devices[4]), | ||||||
|                           config.LibvirtConfigGuestSerial) |                           vconfig.LibvirtConfigGuestSerial) | ||||||
|         self.assertEquals(type(cfg.devices[5]), |         self.assertEquals(type(cfg.devices[5]), | ||||||
|                           config.LibvirtConfigGuestInput) |                           vconfig.LibvirtConfigGuestInput) | ||||||
|         self.assertEquals(type(cfg.devices[6]), |         self.assertEquals(type(cfg.devices[6]), | ||||||
|                           config.LibvirtConfigGuestGraphics) |                           vconfig.LibvirtConfigGuestGraphics) | ||||||
|  |  | ||||||
|         self.assertEquals(type(cfg.clock), |         self.assertEquals(type(cfg.clock), | ||||||
|                           config.LibvirtConfigGuestClock) |                           vconfig.LibvirtConfigGuestClock) | ||||||
|         self.assertEquals(cfg.clock.offset, "utc") |         self.assertEquals(cfg.clock.offset, "utc") | ||||||
|         self.assertEquals(len(cfg.clock.timers), 2) |         self.assertEquals(len(cfg.clock.timers), 2) | ||||||
|         self.assertEquals(type(cfg.clock.timers[0]), |         self.assertEquals(type(cfg.clock.timers[0]), | ||||||
|                           config.LibvirtConfigGuestTimer) |                           vconfig.LibvirtConfigGuestTimer) | ||||||
|         self.assertEquals(type(cfg.clock.timers[1]), |         self.assertEquals(type(cfg.clock.timers[1]), | ||||||
|                           config.LibvirtConfigGuestTimer) |                           vconfig.LibvirtConfigGuestTimer) | ||||||
|         self.assertEquals(cfg.clock.timers[0].name, "pit") |         self.assertEquals(cfg.clock.timers[0].name, "pit") | ||||||
|         self.assertEquals(cfg.clock.timers[0].tickpolicy, |         self.assertEquals(cfg.clock.timers[0].tickpolicy, | ||||||
|                           "delay") |                           "delay") | ||||||
| @@ -691,21 +692,21 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|         self.assertEquals(cfg.os_root, None) |         self.assertEquals(cfg.os_root, None) | ||||||
|         self.assertEquals(len(cfg.devices), 8) |         self.assertEquals(len(cfg.devices), 8) | ||||||
|         self.assertEquals(type(cfg.devices[0]), |         self.assertEquals(type(cfg.devices[0]), | ||||||
|                           config.LibvirtConfigGuestDisk) |                           vconfig.LibvirtConfigGuestDisk) | ||||||
|         self.assertEquals(type(cfg.devices[1]), |         self.assertEquals(type(cfg.devices[1]), | ||||||
|                           config.LibvirtConfigGuestDisk) |                           vconfig.LibvirtConfigGuestDisk) | ||||||
|         self.assertEquals(type(cfg.devices[2]), |         self.assertEquals(type(cfg.devices[2]), | ||||||
|                           config.LibvirtConfigGuestInterface) |                           vconfig.LibvirtConfigGuestInterface) | ||||||
|         self.assertEquals(type(cfg.devices[3]), |         self.assertEquals(type(cfg.devices[3]), | ||||||
|                           config.LibvirtConfigGuestInterface) |                           vconfig.LibvirtConfigGuestInterface) | ||||||
|         self.assertEquals(type(cfg.devices[4]), |         self.assertEquals(type(cfg.devices[4]), | ||||||
|                           config.LibvirtConfigGuestSerial) |                           vconfig.LibvirtConfigGuestSerial) | ||||||
|         self.assertEquals(type(cfg.devices[5]), |         self.assertEquals(type(cfg.devices[5]), | ||||||
|                           config.LibvirtConfigGuestSerial) |                           vconfig.LibvirtConfigGuestSerial) | ||||||
|         self.assertEquals(type(cfg.devices[6]), |         self.assertEquals(type(cfg.devices[6]), | ||||||
|                           config.LibvirtConfigGuestInput) |                           vconfig.LibvirtConfigGuestInput) | ||||||
|         self.assertEquals(type(cfg.devices[7]), |         self.assertEquals(type(cfg.devices[7]), | ||||||
|                           config.LibvirtConfigGuestGraphics) |                           vconfig.LibvirtConfigGuestGraphics) | ||||||
|  |  | ||||||
|     def test_get_guest_config_with_root_device_name(self): |     def test_get_guest_config_with_root_device_name(self): | ||||||
|         self.flags(libvirt_type='uml') |         self.flags(libvirt_type='uml') | ||||||
| @@ -722,11 +723,11 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|         self.assertEquals(cfg.os_root, 'dev/vdb') |         self.assertEquals(cfg.os_root, 'dev/vdb') | ||||||
|         self.assertEquals(len(cfg.devices), 3) |         self.assertEquals(len(cfg.devices), 3) | ||||||
|         self.assertEquals(type(cfg.devices[0]), |         self.assertEquals(type(cfg.devices[0]), | ||||||
|                           config.LibvirtConfigGuestDisk) |                           vconfig.LibvirtConfigGuestDisk) | ||||||
|         self.assertEquals(type(cfg.devices[1]), |         self.assertEquals(type(cfg.devices[1]), | ||||||
|                           config.LibvirtConfigGuestDisk) |                           vconfig.LibvirtConfigGuestDisk) | ||||||
|         self.assertEquals(type(cfg.devices[2]), |         self.assertEquals(type(cfg.devices[2]), | ||||||
|                           config.LibvirtConfigGuestConsole) |                           vconfig.LibvirtConfigGuestConsole) | ||||||
|  |  | ||||||
|     def test_get_guest_config_with_block_device(self): |     def test_get_guest_config_with_block_device(self): | ||||||
|         conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) |         conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) | ||||||
| @@ -739,10 +740,10 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|  |  | ||||||
|         cfg = conn.get_guest_config(instance_ref, [], None, None, info) |         cfg = conn.get_guest_config(instance_ref, [], None, None, info) | ||||||
|         self.assertEquals(type(cfg.devices[2]), |         self.assertEquals(type(cfg.devices[2]), | ||||||
|                           config.LibvirtConfigGuestDisk) |                           vconfig.LibvirtConfigGuestDisk) | ||||||
|         self.assertEquals(cfg.devices[2].target_dev, 'vdc') |         self.assertEquals(cfg.devices[2].target_dev, 'vdc') | ||||||
|         self.assertEquals(type(cfg.devices[3]), |         self.assertEquals(type(cfg.devices[3]), | ||||||
|                           config.LibvirtConfigGuestDisk) |                           vconfig.LibvirtConfigGuestDisk) | ||||||
|         self.assertEquals(cfg.devices[3].target_dev, 'vdd') |         self.assertEquals(cfg.devices[3].target_dev, 'vdd') | ||||||
|  |  | ||||||
|     def test_get_guest_cpu_config_none(self): |     def test_get_guest_cpu_config_none(self): | ||||||
| @@ -772,7 +773,7 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|                                      _fake_network_info(self.stubs, 1), |                                      _fake_network_info(self.stubs, 1), | ||||||
|                                      None, None) |                                      None, None) | ||||||
|         self.assertEquals(type(conf.cpu), |         self.assertEquals(type(conf.cpu), | ||||||
|                           config.LibvirtConfigGuestCPU) |                           vconfig.LibvirtConfigGuestCPU) | ||||||
|         self.assertEquals(conf.cpu.mode, "host-model") |         self.assertEquals(conf.cpu.mode, "host-model") | ||||||
|         self.assertEquals(conf.cpu.model, None) |         self.assertEquals(conf.cpu.model, None) | ||||||
|  |  | ||||||
| @@ -815,7 +816,7 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|                                      _fake_network_info(self.stubs, 1), |                                      _fake_network_info(self.stubs, 1), | ||||||
|                                      None, None) |                                      None, None) | ||||||
|         self.assertEquals(type(conf.cpu), |         self.assertEquals(type(conf.cpu), | ||||||
|                           config.LibvirtConfigGuestCPU) |                           vconfig.LibvirtConfigGuestCPU) | ||||||
|         self.assertEquals(conf.cpu.mode, "host-passthrough") |         self.assertEquals(conf.cpu.mode, "host-passthrough") | ||||||
|         self.assertEquals(conf.cpu.model, None) |         self.assertEquals(conf.cpu.model, None) | ||||||
|  |  | ||||||
| @@ -834,7 +835,7 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|                                      _fake_network_info(self.stubs, 1), |                                      _fake_network_info(self.stubs, 1), | ||||||
|                                      None, None) |                                      None, None) | ||||||
|         self.assertEquals(type(conf.cpu), |         self.assertEquals(type(conf.cpu), | ||||||
|                           config.LibvirtConfigGuestCPU) |                           vconfig.LibvirtConfigGuestCPU) | ||||||
|         self.assertEquals(conf.cpu.mode, "host-model") |         self.assertEquals(conf.cpu.mode, "host-model") | ||||||
|         self.assertEquals(conf.cpu.model, None) |         self.assertEquals(conf.cpu.model, None) | ||||||
|  |  | ||||||
| @@ -854,7 +855,7 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|                                      _fake_network_info(self.stubs, 1), |                                      _fake_network_info(self.stubs, 1), | ||||||
|                                      None, None) |                                      None, None) | ||||||
|         self.assertEquals(type(conf.cpu), |         self.assertEquals(type(conf.cpu), | ||||||
|                           config.LibvirtConfigGuestCPU) |                           vconfig.LibvirtConfigGuestCPU) | ||||||
|         self.assertEquals(conf.cpu.mode, "custom") |         self.assertEquals(conf.cpu.mode, "custom") | ||||||
|         self.assertEquals(conf.cpu.model, "Penryn") |         self.assertEquals(conf.cpu.model, "Penryn") | ||||||
|  |  | ||||||
| @@ -880,12 +881,12 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|  |  | ||||||
|         # Ensure we have a predictable host CPU |         # Ensure we have a predictable host CPU | ||||||
|         def get_host_capabilities_stub(self): |         def get_host_capabilities_stub(self): | ||||||
|             cpu = config.LibvirtConfigGuestCPU() |             cpu = vconfig.LibvirtConfigGuestCPU() | ||||||
|             cpu.model = "Opteron_G4" |             cpu.model = "Opteron_G4" | ||||||
|             cpu.vendor = "AMD" |             cpu.vendor = "AMD" | ||||||
|  |  | ||||||
|             caps = config.LibvirtConfigCaps() |             caps = vconfig.LibvirtConfigCaps() | ||||||
|             caps.host = config.LibvirtConfigCapsHost() |             caps.host = vconfig.LibvirtConfigCapsHost() | ||||||
|             caps.host.cpu = cpu |             caps.host.cpu = cpu | ||||||
|             return caps |             return caps | ||||||
|  |  | ||||||
| @@ -903,7 +904,7 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|                                      _fake_network_info(self.stubs, 1), |                                      _fake_network_info(self.stubs, 1), | ||||||
|                                      None, None) |                                      None, None) | ||||||
|         self.assertEquals(type(conf.cpu), |         self.assertEquals(type(conf.cpu), | ||||||
|                           config.LibvirtConfigGuestCPU) |                           vconfig.LibvirtConfigGuestCPU) | ||||||
|         self.assertEquals(conf.cpu.mode, None) |         self.assertEquals(conf.cpu.mode, None) | ||||||
|         self.assertEquals(conf.cpu.model, "Opteron_G4") |         self.assertEquals(conf.cpu.model, "Opteron_G4") | ||||||
|         self.assertEquals(conf.cpu.vendor, "AMD") |         self.assertEquals(conf.cpu.vendor, "AMD") | ||||||
| @@ -924,7 +925,7 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|                                      _fake_network_info(self.stubs, 1), |                                      _fake_network_info(self.stubs, 1), | ||||||
|                                      None, None) |                                      None, None) | ||||||
|         self.assertEquals(type(conf.cpu), |         self.assertEquals(type(conf.cpu), | ||||||
|                           config.LibvirtConfigGuestCPU) |                           vconfig.LibvirtConfigGuestCPU) | ||||||
|         self.assertEquals(conf.cpu.mode, None) |         self.assertEquals(conf.cpu.mode, None) | ||||||
|         self.assertEquals(conf.cpu.model, "Penryn") |         self.assertEquals(conf.cpu.model, "Penryn") | ||||||
|  |  | ||||||
| @@ -1838,9 +1839,9 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|         # This test is supposed to make sure we don't |         # This test is supposed to make sure we don't | ||||||
|         # override a specifically set uri |         # override a specifically set uri | ||||||
|         # |         # | ||||||
|         # Deliberately not just assigning this string to FLAGS.libvirt_uri and |         # Deliberately not just assigning this string to CONF.libvirt_uri and | ||||||
|         # checking against that later on. This way we make sure the |         # checking against that later on. This way we make sure the | ||||||
|         # implementation doesn't fiddle around with the FLAGS. |         # implementation doesn't fiddle around with the CONF. | ||||||
|         testuri = 'something completely different' |         testuri = 'something completely different' | ||||||
|         self.flags(libvirt_uri=testuri) |         self.flags(libvirt_uri=testuri) | ||||||
|         for (libvirt_type, (expected_uri, checks)) in type_uri_map.iteritems(): |         for (libvirt_type, (expected_uri, checks)) in type_uri_map.iteritems(): | ||||||
| @@ -2064,7 +2065,7 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|     def test_live_migration_raises_exception(self): |     def test_live_migration_raises_exception(self): | ||||||
|         """Confirms recover method is called when exceptions are raised.""" |         """Confirms recover method is called when exceptions are raised.""" | ||||||
|         # Preparing data |         # Preparing data | ||||||
|         self.compute = importutils.import_object(FLAGS.compute_manager) |         self.compute = importutils.import_object(CONF.compute_manager) | ||||||
|         instance_dict = {'host': 'fake', |         instance_dict = {'host': 'fake', | ||||||
|                          'power_state': power_state.RUNNING, |                          'power_state': power_state.RUNNING, | ||||||
|                          'vm_state': vm_states.ACTIVE} |                          'vm_state': vm_states.ACTIVE} | ||||||
| @@ -2075,8 +2076,8 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|         # Preparing mocks |         # Preparing mocks | ||||||
|         vdmock = self.mox.CreateMock(libvirt.virDomain) |         vdmock = self.mox.CreateMock(libvirt.virDomain) | ||||||
|         self.mox.StubOutWithMock(vdmock, "migrateToURI") |         self.mox.StubOutWithMock(vdmock, "migrateToURI") | ||||||
|         _bandwidth = FLAGS.live_migration_bandwidth |         _bandwidth = CONF.live_migration_bandwidth | ||||||
|         vdmock.migrateToURI(FLAGS.live_migration_uri % 'dest', |         vdmock.migrateToURI(CONF.live_migration_uri % 'dest', | ||||||
|                             mox.IgnoreArg(), |                             mox.IgnoreArg(), | ||||||
|                             None, |                             None, | ||||||
|                             _bandwidth).AndRaise(libvirt.libvirtError('ERR')) |                             _bandwidth).AndRaise(libvirt.libvirtError('ERR')) | ||||||
| @@ -2287,14 +2288,14 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|         conn.spawn(self.context, instance, None, [], 'herp', |         conn.spawn(self.context, instance, None, [], 'herp', | ||||||
|                        network_info=network_info) |                        network_info=network_info) | ||||||
|  |  | ||||||
|         path = os.path.join(FLAGS.instances_path, instance.name) |         path = os.path.join(CONF.instances_path, instance.name) | ||||||
|         if os.path.isdir(path): |         if os.path.isdir(path): | ||||||
|             shutil.rmtree(path) |             shutil.rmtree(path) | ||||||
|  |  | ||||||
|         path = os.path.join(FLAGS.instances_path, FLAGS.base_dir_name) |         path = os.path.join(CONF.instances_path, CONF.base_dir_name) | ||||||
|         if os.path.isdir(path): |         if os.path.isdir(path): | ||||||
|             shutil.rmtree(os.path.join(FLAGS.instances_path, |             shutil.rmtree(os.path.join(CONF.instances_path, | ||||||
|                                        FLAGS.base_dir_name)) |                                        CONF.base_dir_name)) | ||||||
|  |  | ||||||
|     def test_get_console_output_file(self): |     def test_get_console_output_file(self): | ||||||
|  |  | ||||||
| @@ -2384,7 +2385,7 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|     def test_get_host_ip_addr(self): |     def test_get_host_ip_addr(self): | ||||||
|         conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False) |         conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False) | ||||||
|         ip = conn.get_host_ip_addr() |         ip = conn.get_host_ip_addr() | ||||||
|         self.assertEquals(ip, FLAGS.my_ip) |         self.assertEquals(ip, CONF.my_ip) | ||||||
|  |  | ||||||
|     def test_broken_connection(self): |     def test_broken_connection(self): | ||||||
|         for (error, domain) in ( |         for (error, domain) in ( | ||||||
| @@ -2574,14 +2575,14 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|         self.stubs.Set(conn, 'get_instance_disk_info', get_info) |         self.stubs.Set(conn, 'get_instance_disk_info', get_info) | ||||||
|  |  | ||||||
|         result = conn.get_disk_available_least() |         result = conn.get_disk_available_least() | ||||||
|         space = fake_libvirt_utils.get_fs_info(FLAGS.instances_path)['free'] |         space = fake_libvirt_utils.get_fs_info(CONF.instances_path)['free'] | ||||||
|         self.assertEqual(result, space / 1024 ** 3) |         self.assertEqual(result, space / 1024 ** 3) | ||||||
|  |  | ||||||
|     def test_cpu_info(self): |     def test_cpu_info(self): | ||||||
|         conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) |         conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) | ||||||
|  |  | ||||||
|         def get_host_capabilities_stub(self): |         def get_host_capabilities_stub(self): | ||||||
|             cpu = config.LibvirtConfigCPU() |             cpu = vconfig.LibvirtConfigCPU() | ||||||
|             cpu.model = "Opteron_G4" |             cpu.model = "Opteron_G4" | ||||||
|             cpu.vendor = "AMD" |             cpu.vendor = "AMD" | ||||||
|             cpu.arch = "x86_64" |             cpu.arch = "x86_64" | ||||||
| @@ -2590,20 +2591,20 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|             cpu.threads = 1 |             cpu.threads = 1 | ||||||
|             cpu.sockets = 4 |             cpu.sockets = 4 | ||||||
|  |  | ||||||
|             cpu.add_feature(config.LibvirtConfigCPUFeature("extapic")) |             cpu.add_feature(vconfig.LibvirtConfigCPUFeature("extapic")) | ||||||
|             cpu.add_feature(config.LibvirtConfigCPUFeature("3dnow")) |             cpu.add_feature(vconfig.LibvirtConfigCPUFeature("3dnow")) | ||||||
|  |  | ||||||
|             caps = config.LibvirtConfigCaps() |             caps = vconfig.LibvirtConfigCaps() | ||||||
|             caps.host = config.LibvirtConfigCapsHost() |             caps.host = vconfig.LibvirtConfigCapsHost() | ||||||
|             caps.host.cpu = cpu |             caps.host.cpu = cpu | ||||||
|  |  | ||||||
|             guest = config.LibvirtConfigGuest() |             guest = vconfig.LibvirtConfigGuest() | ||||||
|             guest.ostype = vm_mode.HVM |             guest.ostype = vm_mode.HVM | ||||||
|             guest.arch = "x86_64" |             guest.arch = "x86_64" | ||||||
|             guest.domtype = ["kvm"] |             guest.domtype = ["kvm"] | ||||||
|             caps.guests.append(guest) |             caps.guests.append(guest) | ||||||
|  |  | ||||||
|             guest = config.LibvirtConfigGuest() |             guest = vconfig.LibvirtConfigGuest() | ||||||
|             guest.ostype = vm_mode.HVM |             guest.ostype = vm_mode.HVM | ||||||
|             guest.arch = "i686" |             guest.arch = "i686" | ||||||
|             guest.domtype = ["kvm"] |             guest.domtype = ["kvm"] | ||||||
| @@ -3016,15 +3017,15 @@ class LibvirtConnTestCase(test.TestCase): | |||||||
|         conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) |         conn = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) | ||||||
|  |  | ||||||
|         def get_host_capabilities_stub(self): |         def get_host_capabilities_stub(self): | ||||||
|             caps = config.LibvirtConfigCaps() |             caps = vconfig.LibvirtConfigCaps() | ||||||
|  |  | ||||||
|             guest = config.LibvirtConfigGuest() |             guest = vconfig.LibvirtConfigGuest() | ||||||
|             guest.ostype = 'hvm' |             guest.ostype = 'hvm' | ||||||
|             guest.arch = 'x86_64' |             guest.arch = 'x86_64' | ||||||
|             guest.domtype = ['kvm', 'qemu'] |             guest.domtype = ['kvm', 'qemu'] | ||||||
|             caps.guests.append(guest) |             caps.guests.append(guest) | ||||||
|  |  | ||||||
|             guest = config.LibvirtConfigGuest() |             guest = vconfig.LibvirtConfigGuest() | ||||||
|             guest.ostype = 'hvm' |             guest.ostype = 'hvm' | ||||||
|             guest.arch = 'i686' |             guest.arch = 'i686' | ||||||
|             guest.domtype = ['kvm'] |             guest.domtype = ['kvm'] | ||||||
| @@ -4143,7 +4144,7 @@ class LibvirtDriverTestCase(test.TestCase): | |||||||
|                                             _fake_network_info(self.stubs, 1)) |                                             _fake_network_info(self.stubs, 1)) | ||||||
|  |  | ||||||
|     def test_cleanup_resize_same_host(self): |     def test_cleanup_resize_same_host(self): | ||||||
|         ins_ref = self._create_instance({'host': FLAGS.host}) |         ins_ref = self._create_instance({'host': CONF.host}) | ||||||
|  |  | ||||||
|         def fake_os_path_exists(path): |         def fake_os_path_exists(path): | ||||||
|             return True |             return True | ||||||
| @@ -4159,7 +4160,7 @@ class LibvirtDriverTestCase(test.TestCase): | |||||||
|                                             _fake_network_info(self.stubs, 1)) |                                             _fake_network_info(self.stubs, 1)) | ||||||
|  |  | ||||||
|     def test_cleanup_resize_not_same_host(self): |     def test_cleanup_resize_not_same_host(self): | ||||||
|         host = 'not' + FLAGS.host |         host = 'not' + CONF.host | ||||||
|         ins_ref = self._create_instance({'host': host}) |         ins_ref = self._create_instance({'host': host}) | ||||||
|  |  | ||||||
|         def fake_os_path_exists(path): |         def fake_os_path_exists(path): | ||||||
|   | |||||||
| @@ -16,13 +16,14 @@ | |||||||
|  |  | ||||||
| from lxml import etree | from lxml import etree | ||||||
|  |  | ||||||
|  | from nova import config | ||||||
| from nova import flags | from nova import flags | ||||||
| from nova import test | from nova import test | ||||||
| from nova import utils | from nova import utils | ||||||
| from nova.virt.libvirt import config | from nova.virt.libvirt import config as vconfig | ||||||
| from nova.virt.libvirt import vif | from nova.virt.libvirt import vif | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS | CONF = config.CONF | ||||||
|  |  | ||||||
|  |  | ||||||
| class LibvirtVifTestCase(test.TestCase): | class LibvirtVifTestCase(test.TestCase): | ||||||
| @@ -66,7 +67,7 @@ class LibvirtVifTestCase(test.TestCase): | |||||||
|         self.stubs.Set(utils, 'execute', fake_execute) |         self.stubs.Set(utils, 'execute', fake_execute) | ||||||
|  |  | ||||||
|     def _get_instance_xml(self, driver): |     def _get_instance_xml(self, driver): | ||||||
|         conf = config.LibvirtConfigGuest() |         conf = vconfig.LibvirtConfigGuest() | ||||||
|         conf.virt_type = "qemu" |         conf.virt_type = "qemu" | ||||||
|         conf.name = "fake-name" |         conf.name = "fake-name" | ||||||
|         conf.uuid = "fake-uuid" |         conf.uuid = "fake-uuid" | ||||||
| @@ -122,7 +123,7 @@ class LibvirtVifTestCase(test.TestCase): | |||||||
|         self.assertEqual(node.get("type"), "bridge") |         self.assertEqual(node.get("type"), "bridge") | ||||||
|  |  | ||||||
|         br_name = node.find("source").get("bridge") |         br_name = node.find("source").get("bridge") | ||||||
|         self.assertEqual(br_name, FLAGS.libvirt_ovs_bridge) |         self.assertEqual(br_name, CONF.libvirt_ovs_bridge) | ||||||
|         mac = node.find("mac").get("address") |         mac = node.find("mac").get("address") | ||||||
|         self.assertEqual(mac, self.mapping['mac']) |         self.assertEqual(mac, self.mapping['mac']) | ||||||
|         vp = node.find("virtualport") |         vp = node.find("virtualport") | ||||||
|   | |||||||
| @@ -30,8 +30,6 @@ from nova.virt.powervm import driver as powervm_driver | |||||||
| from nova.virt.powervm import lpar | from nova.virt.powervm import lpar | ||||||
| from nova.virt.powervm import operator | from nova.virt.powervm import operator | ||||||
|  |  | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS |  | ||||||
| LOG = logging.getLogger(__name__) | LOG = logging.getLogger(__name__) | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -27,8 +27,6 @@ from nova.virt import driver | |||||||
|  |  | ||||||
| from nova.openstack.common import jsonutils | from nova.openstack.common import jsonutils | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class TestVirtDriver(test.TestCase): | class TestVirtDriver(test.TestCase): | ||||||
|     def test_block_device(self): |     def test_block_device(self): | ||||||
|   | |||||||
| @@ -32,9 +32,6 @@ from nova.virt.vmwareapi import driver | |||||||
| from nova.virt.vmwareapi import fake as vmwareapi_fake | from nova.virt.vmwareapi import fake as vmwareapi_fake | ||||||
|  |  | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS |  | ||||||
|  |  | ||||||
|  |  | ||||||
| class VMWareAPIVMTestCase(test.TestCase): | class VMWareAPIVMTestCase(test.TestCase): | ||||||
|     """Unit tests for Vmware API connection calls.""" |     """Unit tests for Vmware API connection calls.""" | ||||||
|  |  | ||||||
|   | |||||||
| @@ -29,6 +29,7 @@ from nova.compute import instance_types | |||||||
| from nova.compute import power_state | from nova.compute import power_state | ||||||
| from nova.compute import task_states | from nova.compute import task_states | ||||||
| from nova.compute import vm_states | from nova.compute import vm_states | ||||||
|  | from nova import config | ||||||
| from nova import context | from nova import context | ||||||
| from nova import db | from nova import db | ||||||
| from nova import exception | from nova import exception | ||||||
| @@ -55,7 +56,7 @@ from nova.virt.xenapi import volume_utils | |||||||
|  |  | ||||||
| LOG = logging.getLogger(__name__) | LOG = logging.getLogger(__name__) | ||||||
|  |  | ||||||
| FLAGS = flags.FLAGS | CONF = config.CONF | ||||||
|  |  | ||||||
| IMAGE_MACHINE = '1' | IMAGE_MACHINE = '1' | ||||||
| IMAGE_KERNEL = '2' | IMAGE_KERNEL = '2' | ||||||
| @@ -173,7 +174,7 @@ class XenAPIVolumeTestCase(stubs.XenAPITestBase): | |||||||
|         vol['user_id'] = 'fake' |         vol['user_id'] = 'fake' | ||||||
|         vol['project_id'] = 'fake' |         vol['project_id'] = 'fake' | ||||||
|         vol['host'] = 'localhost' |         vol['host'] = 'localhost' | ||||||
|         vol['availability_zone'] = FLAGS.node_availability_zone |         vol['availability_zone'] = CONF.node_availability_zone | ||||||
|         vol['status'] = "creating" |         vol['status'] = "creating" | ||||||
|         vol['attach_status'] = "detached" |         vol['attach_status'] = "detached" | ||||||
|         return db.volume_create(self.context, vol) |         return db.volume_create(self.context, vol) | ||||||
| @@ -265,7 +266,7 @@ class XenAPIVMTestCase(stubs.XenAPITestBase): | |||||||
|     """Unit tests for VM operations.""" |     """Unit tests for VM operations.""" | ||||||
|     def setUp(self): |     def setUp(self): | ||||||
|         super(XenAPIVMTestCase, self).setUp() |         super(XenAPIVMTestCase, self).setUp() | ||||||
|         self.network = importutils.import_object(FLAGS.network_manager) |         self.network = importutils.import_object(CONF.network_manager) | ||||||
|         self.flags(disable_process_locking=True, |         self.flags(disable_process_locking=True, | ||||||
|                    instance_name_template='%d', |                    instance_name_template='%d', | ||||||
|                    firewall_driver='nova.virt.xenapi.firewall.' |                    firewall_driver='nova.virt.xenapi.firewall.' | ||||||
| @@ -275,7 +276,7 @@ class XenAPIVMTestCase(stubs.XenAPITestBase): | |||||||
|         xenapi_fake.create_local_srs() |         xenapi_fake.create_local_srs() | ||||||
|         xenapi_fake.create_local_pifs() |         xenapi_fake.create_local_pifs() | ||||||
|         db_fakes.stub_out_db_instance_api(self.stubs) |         db_fakes.stub_out_db_instance_api(self.stubs) | ||||||
|         xenapi_fake.create_network('fake', FLAGS.flat_network_bridge) |         xenapi_fake.create_network('fake', CONF.flat_network_bridge) | ||||||
|         stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests) |         stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests) | ||||||
|         stubs.stubout_get_this_vm_uuid(self.stubs) |         stubs.stubout_get_this_vm_uuid(self.stubs) | ||||||
|         stubs.stubout_is_vdi_pv(self.stubs) |         stubs.stubout_is_vdi_pv(self.stubs) | ||||||
| @@ -511,16 +512,16 @@ class XenAPIVMTestCase(stubs.XenAPITestBase): | |||||||
|         self.assertEquals(self.vm['HVM_boot_policy'], '') |         self.assertEquals(self.vm['HVM_boot_policy'], '') | ||||||
|  |  | ||||||
|     def _list_vdis(self): |     def _list_vdis(self): | ||||||
|         url = FLAGS.xenapi_connection_url |         url = CONF.xenapi_connection_url | ||||||
|         username = FLAGS.xenapi_connection_username |         username = CONF.xenapi_connection_username | ||||||
|         password = FLAGS.xenapi_connection_password |         password = CONF.xenapi_connection_password | ||||||
|         session = xenapi_conn.XenAPISession(url, username, password) |         session = xenapi_conn.XenAPISession(url, username, password) | ||||||
|         return session.call_xenapi('VDI.get_all') |         return session.call_xenapi('VDI.get_all') | ||||||
|  |  | ||||||
|     def _list_vms(self): |     def _list_vms(self): | ||||||
|         url = FLAGS.xenapi_connection_url |         url = CONF.xenapi_connection_url | ||||||
|         username = FLAGS.xenapi_connection_username |         username = CONF.xenapi_connection_username | ||||||
|         password = FLAGS.xenapi_connection_password |         password = CONF.xenapi_connection_password | ||||||
|         session = xenapi_conn.XenAPISession(url, username, password) |         session = xenapi_conn.XenAPISession(url, username, password) | ||||||
|         return session.call_xenapi('VM.get_all') |         return session.call_xenapi('VM.get_all') | ||||||
|  |  | ||||||
| @@ -772,7 +773,7 @@ class XenAPIVMTestCase(stubs.XenAPITestBase): | |||||||
|         self.network.allocate_for_instance(ctxt, |         self.network.allocate_for_instance(ctxt, | ||||||
|                           instance_id=2, |                           instance_id=2, | ||||||
|                           instance_uuid='00000000-0000-0000-0000-000000000002', |                           instance_uuid='00000000-0000-0000-0000-000000000002', | ||||||
|                           host=FLAGS.host, |                           host=CONF.host, | ||||||
|                           vpn=None, |                           vpn=None, | ||||||
|                           rxtx_factor=3, |                           rxtx_factor=3, | ||||||
|                           project_id=self.project_id) |                           project_id=self.project_id) | ||||||
| @@ -1003,7 +1004,7 @@ class XenAPIMigrateInstance(stubs.XenAPITestBase): | |||||||
|                                    'Dom0IptablesFirewallDriver') |                                    'Dom0IptablesFirewallDriver') | ||||||
|         stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests) |         stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests) | ||||||
|         db_fakes.stub_out_db_instance_api(self.stubs) |         db_fakes.stub_out_db_instance_api(self.stubs) | ||||||
|         xenapi_fake.create_network('fake', FLAGS.flat_network_bridge) |         xenapi_fake.create_network('fake', CONF.flat_network_bridge) | ||||||
|         self.user_id = 'fake' |         self.user_id = 'fake' | ||||||
|         self.project_id = 'fake' |         self.project_id = 'fake' | ||||||
|         self.context = context.RequestContext(self.user_id, self.project_id) |         self.context = context.RequestContext(self.user_id, self.project_id) | ||||||
| @@ -1702,7 +1703,7 @@ class XenAPIDom0IptablesFirewallTestCase(stubs.XenAPITestBase): | |||||||
|         stubs.stubout_session(self.stubs, stubs.FakeSessionForFirewallTests, |         stubs.stubout_session(self.stubs, stubs.FakeSessionForFirewallTests, | ||||||
|                               test_case=self) |                               test_case=self) | ||||||
|         self.context = context.RequestContext(self.user_id, self.project_id) |         self.context = context.RequestContext(self.user_id, self.project_id) | ||||||
|         self.network = importutils.import_object(FLAGS.network_manager) |         self.network = importutils.import_object(CONF.network_manager) | ||||||
|         self.conn = xenapi_conn.XenAPIDriver(fake.FakeVirtAPI(), False) |         self.conn = xenapi_conn.XenAPIDriver(fake.FakeVirtAPI(), False) | ||||||
|         self.fw = self.conn._vmops.firewall_driver |         self.fw = self.conn._vmops.firewall_driver | ||||||
|  |  | ||||||
| @@ -2030,7 +2031,7 @@ class XenAPIAggregateTestCase(stubs.XenAPITestBase): | |||||||
|         stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests) |         stubs.stubout_session(self.stubs, stubs.FakeSessionForVMTests) | ||||||
|         self.context = context.get_admin_context() |         self.context = context.get_admin_context() | ||||||
|         self.conn = xenapi_conn.XenAPIDriver(fake.FakeVirtAPI(), False) |         self.conn = xenapi_conn.XenAPIDriver(fake.FakeVirtAPI(), False) | ||||||
|         self.compute = importutils.import_object(FLAGS.compute_manager) |         self.compute = importutils.import_object(CONF.compute_manager) | ||||||
|         self.api = compute_api.AggregateAPI() |         self.api = compute_api.AggregateAPI() | ||||||
|         values = {'name': 'test_aggr', |         values = {'name': 'test_aggr', | ||||||
|                   'availability_zone': 'test_zone', |                   'availability_zone': 'test_zone', | ||||||
| @@ -2548,7 +2549,7 @@ class XenAPILiveMigrateTestCase(stubs.XenAPITestBase): | |||||||
|                 self.metadetails = {"host": "test_host_uuid"} |                 self.metadetails = {"host": "test_host_uuid"} | ||||||
|  |  | ||||||
|         def fake_aggregate_get_by_host(context, host, key=None): |         def fake_aggregate_get_by_host(context, host, key=None): | ||||||
|             self.assertEqual(FLAGS.host, host) |             self.assertEqual(CONF.host, host) | ||||||
|             return [fake_aggregate()] |             return [fake_aggregate()] | ||||||
|  |  | ||||||
|         self.stubs.Set(db, "aggregate_get_by_host", |         self.stubs.Set(db, "aggregate_get_by_host", | ||||||
| @@ -2565,7 +2566,7 @@ class XenAPILiveMigrateTestCase(stubs.XenAPITestBase): | |||||||
|                 self.metadetails = {"dest_other": "test_host_uuid"} |                 self.metadetails = {"dest_other": "test_host_uuid"} | ||||||
|  |  | ||||||
|         def fake_aggregate_get_by_host(context, host, key=None): |         def fake_aggregate_get_by_host(context, host, key=None): | ||||||
|             self.assertEqual(FLAGS.host, host) |             self.assertEqual(CONF.host, host) | ||||||
|             return [fake_aggregate()] |             return [fake_aggregate()] | ||||||
|  |  | ||||||
|         self.stubs.Set(db, "aggregate_get_by_host", |         self.stubs.Set(db, "aggregate_get_by_host", | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jenkins
					Jenkins