Added format_output method

This commit is contained in:
tengqm
2015-02-15 19:50:41 +08:00
parent c3f756dc1b
commit 2501094213

View File

@@ -167,3 +167,12 @@ def process_stack_spec(spec):
}
return new_spec
def format_output(output, format='yaml'):
fmt = format.lower()
try:
return supported_formats[fmt](output)
except KeyError:
raise exc.HTTPUnsupported(_('The format(%s) is unsupported.')
% fmt)