diff --git a/nova_tests/test_notifier.py b/nova_tests/test_notifier.py index 118d540db..9666b41dc 100644 --- a/nova_tests/test_notifier.py +++ b/nova_tests/test_notifier.py @@ -32,7 +32,11 @@ from stevedore.tests import manager as test_manager ## works. Please don't change them. from nova.tests import fake_network from nova.compute import vm_states -from nova.compute import instance_types +try: + from nova.compute import flavors +except ImportError: + from nova.compute import instance_types as flavors + from nova import config from nova import context from nova import db @@ -128,7 +132,7 @@ class TestNovaNotifier(base.TestCase): self.stubs.Set(db, 'instance_update_and_get_original', lambda context, uuid, kwargs: (self.instance, self.instance)) - self.stubs.Set(instance_types, 'extract_instance_type', + self.stubs.Set(flavors, 'extract_instance_type', lambda ref: {}) # Set up to capture the notification messages generated by the