diff --git a/nova/compute/api.py b/nova/compute/api.py index 8c643f5e72b..2b7fca5b15d 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -75,7 +75,7 @@ LOG = logging.getLogger(__name__) -get_notifier = functools.partial(notifier.get_notifier, service='aggregate') +get_notifier = functools.partial(notifier.get_notifier, service='compute') wrap_exception = functools.partial(exception.wrap_exception, get_notifier=get_notifier) diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 89185da635b..60e57713fa0 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -8338,9 +8338,13 @@ def test_add_host_to_aggregate_raise_not_found(self): # Ensure ComputeHostNotFound is raised when adding invalid host. aggr = self.api.create_aggregate(self.context, 'fake_aggregate', 'fake_zone') + fake_notifier.NOTIFICATIONS = [] self.assertRaises(exception.ComputeHostNotFound, self.api.add_host_to_aggregate, self.context, aggr['id'], 'invalid_host') + self.assertEqual(len(fake_notifier.NOTIFICATIONS), 2) + self.assertEqual(fake_notifier.NOTIFICATIONS[1].publisher_id, + 'compute.fake-mini') def test_remove_host_from_aggregate_active(self): # Ensure we can remove a host from an aggregate.