Merge "Add formatters for 'tags' in method _do_stack_show"

This commit is contained in:
Jenkins
2016-01-28 14:42:19 +00:00
committed by Gerrit Code Review
3 changed files with 8 additions and 3 deletions

View File

@@ -419,6 +419,7 @@ def _show_stack(heat_client, stack_id, format='', short=False):
formatters['parameters'] = complex_formatter
formatters['outputs'] = complex_formatter
formatters['links'] = complex_formatter
formatters['tags'] = complex_formatter
return columns, utils.get_item_properties(data, columns,
formatters=formatters)

View File

@@ -754,7 +754,8 @@ class ShellTestUserPass(ShellBase):
"id": "1",
"stack_name": "teststack",
"stack_status": 'CREATE_COMPLETE',
"creation_time": "2012-10-25T01:58:47Z"
"creation_time": "2012-10-25T01:58:47Z",
"tags": [u'tag1', u'tag2']
}}
resp = fakes.FakeHTTPResponse(
200,
@@ -777,9 +778,11 @@ class ShellTestUserPass(ShellBase):
'stack_name',
'stack_status',
'creation_time',
'tags',
'teststack',
'CREATE_COMPLETE',
'2012-10-25T01:58:47Z'
'2012-10-25T01:58:47Z',
"['tag1', 'tag2']",
]
for r in required:
self.assertRegexpMatches(list_text, r)

View File

@@ -1575,7 +1575,8 @@ def _do_stack_show(hc, fields):
'stack_status_reason': utils.text_wrap_formatter,
'parameters': utils.json_formatter,
'outputs': utils.json_formatter,
'links': utils.link_formatter
'links': utils.link_formatter,
'tags': utils.json_formatter
}
utils.print_dict(stack.to_dict(), formatters=formatters)