summaryrefslogtreecommitdiff
path: root/heatclient/osc
diff options
context:
space:
mode:
authorhuangtianhua <huangtianhua@huawei.com>2016-10-18 10:32:01 +0800
committerhuangtianhua <huangtianhua@huawei.com>2016-10-20 02:15:20 +0000
commit0ac4a80dada9a7fb9ee13d965c496b2b7341a4d5 (patch)
treedc44ac242b9d145b8f6a6e9e53834659759780cf /heatclient/osc
parentc14e1827f67df9293a63fbe26f336c83f0593514 (diff)
downloadpython-heatclient-0ac4a80dada9a7fb9ee13d965c496b2b7341a4d5.tar.gz
Return condition functions based on the filter param
Add 'with_condition_func' filter param for API template-function-list, if the param set to true, the response will include the condition functions. Change-Id: Ia7b4da71ed5c3da105dd23917e4921a96e445026 Closes-Bug: #1625505
Diffstat (limited to 'heatclient/osc')
-rw-r--r--heatclient/osc/v1/template.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/heatclient/osc/v1/template.py b/heatclient/osc/v1/template.py
index 1b089dd..c4ed124 100644
--- a/heatclient/osc/v1/template.py
+++ b/heatclient/osc/v1/template.py
@@ -57,6 +57,12 @@ class FunctionList(command.Lister):
metavar='<template-version>',
help=_('Template version to get the functions for')
)
+ parser.add_argument(
+ '--with_conditions',
+ default=False,
+ action='store_true',
+ help=_('Show condition functions for template.')
+ )
return parser
@@ -67,7 +73,8 @@ class FunctionList(command.Lister):
version = parsed_args.template_version
try:
- functions = client.template_versions.get(version)
+ functions = client.template_versions.get(
+ version, with_condition_func=parsed_args.with_conditions)
except exc.HTTPNotFound:
msg = _('Template version not found: %s') % version
raise exc.CommandError(msg)