Skip to content

Commit

Permalink
Change service id to compute for compute/api.py
Browse files Browse the repository at this point in the history
Now the default service id for nova api notification is aggregate,
this is not accurate, we should change it to compute.

Fix bug 1225579

Change-Id: Ife558024c57d9fd035cd1a618063c656e03c52a3
  • Loading branch information
Jay Lau committed Sep 20, 2013
1 parent b4661db commit 2c89a8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nova/compute/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 4 additions & 0 deletions nova/tests/compute/test_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -8297,9 +8297,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.
Expand Down

0 comments on commit 2c89a8b

Please sign in to comment.