diff options
author | Sulochan Acharya <sulochan@gmail.com> | 2013-05-29 18:04:46 -0500 |
---|---|---|
committer | Sulochan Acharya <sulochan@gmail.com> | 2013-05-31 13:40:44 -0500 |
commit | 9b1ce2108189cdfd499e116500fad566670260bc (patch) | |
tree | 4ed8bd8c85363aa61e849484f84bc00590e2fc2e /heatclient/common/utils.py | |
parent | 2e6e49f7fa49c977fb9e406e1a49a99792e80775 (diff) | |
download | python-heatclient-9b1ce2108189cdfd499e116500fad566670260bc.tar.gz |
Fixes text split for parameters
Make text split only on the first "=" element, this will
allow for values to have multiple "=" in the string.
Also, ensure that key = value pair is honored in parameters,
exit otherwise with error message. Tests included.
Fixes bug #1183842
Change-Id: Ic8897405c61dee49f5927b53f055b0d0686eea7d
Diffstat (limited to 'heatclient/common/utils.py')
-rw-r--r-- | heatclient/common/utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/heatclient/common/utils.py b/heatclient/common/utils.py index 07e20b8..2f29b36 100644 --- a/heatclient/common/utils.py +++ b/heatclient/common/utils.py @@ -130,6 +130,10 @@ def format_parameters(params): parameters = {} if params: for count, p in enumerate(params.split(';'), 1): - (n, v) = p.split('=') + try: + (n, v) = p.split(('='), 1) + except ValueError: + raise exc.MalformedRequestBody() + parameters[n] = v return parameters |