Fix event filtering in event-show

The event-show API was broken recently by not filtering with the given
event ID. This fixes the issue.

Change-Id: I0a37b27049986ad2ed8c19a18861f897c739e64d
Closes-Bug: #1523807
This commit is contained in:
Thomas Herve 2015-12-08 10:20:11 +01:00
parent 2467d83377
commit 56263647b0
2 changed files with 7 additions and 4 deletions

View File

@ -143,7 +143,7 @@ class EventController(object):
def show(self, req, identity, resource_name, event_id):
"""Gets detailed information for an event."""
filters = {"resource_name": resource_name}
filters = {"resource_name": resource_name, "uuid": event_id}
events = self._event_list(req, identity, filters=filters, detail=True)
if not events:
raise exc.HTTPNotFound(_('No event %s found') % event_id)

View File

@ -469,7 +469,8 @@ class EventControllerTest(tools.ControllerTest, common.HeatTestCase):
kwargs = {'stack_identity': stack_identity,
'limit': None, 'sort_keys': None, 'marker': None,
'sort_dir': None, 'filters': {'resource_name': res_name}}
'sort_dir': None,
'filters': {'resource_name': res_name, 'uuid': event_id}}
engine_resp = [
{
@ -535,7 +536,8 @@ class EventControllerTest(tools.ControllerTest, common.HeatTestCase):
kwargs = {'stack_identity': stack_identity,
'limit': None, 'sort_keys': None, 'marker': None,
'sort_dir': None, 'filters': {'resource_name': res_name}}
'sort_dir': None,
'filters': {'resource_name': res_name, 'uuid': '42'}}
engine_resp = []
self.m.StubOutWithMock(rpc_client.EngineClient, 'call')
@ -563,7 +565,8 @@ class EventControllerTest(tools.ControllerTest, common.HeatTestCase):
kwargs = {'stack_identity': stack_identity,
'limit': None, 'sort_keys': None, 'marker': None,
'sort_dir': None, 'filters': {'resource_name': res_name}}
'sort_dir': None,
'filters': {'resource_name': res_name, 'uuid': '42'}}
error = heat_exc.EntityNotFound(entity='Stack', name='a')
self.m.StubOutWithMock(rpc_client.EngineClient, 'call')