Merge "Allow filtering of stacks by username, tenant and owner_id"

This commit is contained in:
Jenkins 2014-09-13 17:14:03 +00:00 committed by Gerrit Code Review
commit d905dbcfaf
2 changed files with 10 additions and 1 deletions

View File

@ -158,6 +158,9 @@ class StackController(object):
'status': 'mixed',
'name': 'mixed',
'action': 'mixed',
'tenant': 'mixed',
'username': 'mixed',
'owner_id': 'mixed',
}
whitelist = {
'limit': 'single',

View File

@ -411,6 +411,9 @@ class StackControllerTest(ControllerTest, HeatTestCase):
'status': 'fake status',
'name': 'fake name',
'action': 'fake action',
'username': 'fake username',
'tenant': 'fake tenant',
'owner_id': 'fake owner-id',
'balrog': 'you shall not pass!'
}
req = self._get('/stacks', params=params)
@ -423,10 +426,13 @@ class StackControllerTest(ControllerTest, HeatTestCase):
self.assertIn('filters', engine_args)
filters = engine_args['filters']
self.assertEqual(3, len(filters))
self.assertEqual(6, len(filters))
self.assertIn('status', filters)
self.assertIn('name', filters)
self.assertIn('action', filters)
self.assertIn('username', filters)
self.assertIn('tenant', filters)
self.assertIn('owner_id', filters)
self.assertNotIn('balrog', filters)
def test_index_returns_stack_count_if_with_count_is_true(