Merge "Add filtering for stack-list by stack_id"

This commit is contained in:
Jenkins 2015-04-23 04:01:06 +00:00 committed by Gerrit Code Review
commit a41bb3a6e5
2 changed files with 4 additions and 1 deletions

View File

@ -171,6 +171,7 @@ class StackController(object):
def _index(self, req, tenant_safe=True): def _index(self, req, tenant_safe=True):
filter_whitelist = { filter_whitelist = {
'id': 'mixed',
'status': 'mixed', 'status': 'mixed',
'name': 'mixed', 'name': 'mixed',
'action': 'mixed', 'action': 'mixed',

View File

@ -435,6 +435,7 @@ class StackControllerTest(ControllerTest, common.HeatTestCase):
def test_index_whitelist_filter_params(self, mock_call, mock_enforce): def test_index_whitelist_filter_params(self, mock_call, mock_enforce):
self._mock_enforce_setup(mock_enforce, 'index', True) self._mock_enforce_setup(mock_enforce, 'index', True)
params = { params = {
'id': 'fake id',
'status': 'fake status', 'status': 'fake status',
'name': 'fake name', 'name': 'fake name',
'action': 'fake action', 'action': 'fake action',
@ -453,7 +454,8 @@ class StackControllerTest(ControllerTest, common.HeatTestCase):
self.assertIn('filters', engine_args) self.assertIn('filters', engine_args)
filters = engine_args['filters'] filters = engine_args['filters']
self.assertEqual(6, len(filters)) self.assertEqual(7, len(filters))
self.assertIn('id', filters)
self.assertIn('status', filters) self.assertIn('status', filters)
self.assertIn('name', filters) self.assertIn('name', filters)
self.assertIn('action', filters) self.assertIn('action', filters)