diff options
author | Anderson Mesquita <andersonvom@gmail.com> | 2014-01-08 18:47:34 -0600 |
---|---|---|
committer | Richard Lee <rblee88@gmail.com> | 2014-02-05 14:38:30 -0600 |
commit | ff9bde4001bdf47cfca1d2ad39b64a90d8b27c34 (patch) | |
tree | 417b5f6ecac620289dc63844e8e9a73ede7ea67c /heatclient/common/utils.py | |
parent | cda180eed49a70b2645cf5e21b1dfe130d96d957 (diff) | |
download | python-heatclient-ff9bde4001bdf47cfca1d2ad39b64a90d8b27c34.tar.gz |
Add filter option to stack-list
Add ability to use filters on stack-list by passing a ``--filters``
options to the command line. This option can appear multiple times or
be used once with several key=value filters separated by semicolons. If
the same key appears more than once, both will be taken into account
when sending the request to the API.
e.g.:
The option:
``--filters status=COMPLETE;status=FAILED``
Will issue the call:
``/stacks?status=COMPLETE&status=FAILED``
Closes-Bug: 1268816
Change-Id: I553d6b5e3ceebdb24dcd4e4c8e409a4375d72333
Diffstat (limited to 'heatclient/common/utils.py')
-rw-r--r-- | heatclient/common/utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/heatclient/common/utils.py b/heatclient/common/utils.py index b5f4bda..fbd4d8d 100644 --- a/heatclient/common/utils.py +++ b/heatclient/common/utils.py @@ -162,7 +162,13 @@ def format_parameters(params): 'Use the key=value format') raise exc.CommandError(msg) - parameters[n] = v + if n not in parameters: + parameters[n] = v + else: + if not isinstance(parameters[n], list): + parameters[n] = [parameters[n]] + parameters[n].append(v) + return parameters |