diff --git a/nova/tests/test_volume.py b/nova/tests/test_volume.py index aef0b57f..57ca5278 100644 --- a/nova/tests/test_volume.py +++ b/nova/tests/test_volume.py @@ -30,6 +30,7 @@ from nova import exception from nova import flags from nova.openstack.common import importutils from nova.openstack.common import log as logging +from nova.openstack.common.notifier import api as notifier_api from nova.openstack.common.notifier import test_notifier from nova.openstack.common import rpc import nova.policy @@ -50,7 +51,7 @@ class VolumeTestCase(test.TestCase): self.compute = importutils.import_object(FLAGS.compute_manager) self.flags(compute_driver='nova.virt.fake.FakeDriver') self.stubs.Set(nova.flags.FLAGS, 'notification_driver', - 'nova.openstack.common.notifier.test_notifier') + ['nova.openstack.common.notifier.test_notifier']) self.volume = importutils.import_object(FLAGS.volume_manager) self.context = context.get_admin_context() instance = db.instance_create(self.context, {}) @@ -60,6 +61,7 @@ class VolumeTestCase(test.TestCase): def tearDown(self): db.instance_destroy(self.context, self.instance_uuid) + notifier_api._reset_drivers() super(VolumeTestCase, self).tearDown() @staticmethod diff --git a/nova/tests/test_volume_utils.py b/nova/tests/test_volume_utils.py index 8d0caab2..cd81e67f 100644 --- a/nova/tests/test_volume_utils.py +++ b/nova/tests/test_volume_utils.py @@ -22,6 +22,7 @@ from nova import db from nova import flags from nova.openstack.common import importutils from nova.openstack.common import log as logging +from nova.openstack.common.notifier import api as notifier_api from nova.openstack.common.notifier import test_notifier from nova import test from nova.volume import utils as volume_utils @@ -39,7 +40,7 @@ class UsageInfoTestCase(test.TestCase): stub_network=True, host='fake') self.stubs.Set(flags.FLAGS, 'notification_driver', - 'nova.openstack.common.notifier.test_notifier') + ['nova.openstack.common.notifier.test_notifier']) self.volume = importutils.import_object(FLAGS.volume_manager) self.user_id = 'fake' self.project_id = 'fake' @@ -48,6 +49,10 @@ class UsageInfoTestCase(test.TestCase): self.context = context.RequestContext(self.user_id, self.project_id) test_notifier.NOTIFICATIONS = [] + def tearDown(self): + notifier_api._reset_drivers() + super(UsageInfoTestCase, self).tearDown() + def _create_volume(self, params={}): """Create a test volume""" vol = {}