summaryrefslogtreecommitdiff
path: root/glanceclient/v1
diff options
context:
space:
mode:
authorDavid Sariel <dsariel@redhat.com>2015-09-02 14:48:17 +0300
committerFlavio Percoco <flaper87@gmail.com>2015-09-09 14:35:59 +0200
commit2c7da7cb6077b89a7e195f76ed092ea7dfe65e02 (patch)
tree2650b9d414f6ed3eca235c536743b4fbf294f183 /glanceclient/v1
parent5507d849017829a51da005737705f72e832cdc4a (diff)
downloadpython-glanceclient-2c7da7cb6077b89a7e195f76ed092ea7dfe65e02.tar.gz
Invalid output running the command 'glance image-show <image_id>'
Running the command returns the string 'id' and fails on exception. In function _image_meta_from_headers the meta variable was not properly set because key was not lowercased. Converting key to lowercase solves the problem. NOTE: this is a compatibility fix for urllib3 >= 1.11 Closes-Bug: #1487645 Co-Authored-by: Flavio Percoco <flavio@redhat.com> Change-Id: I1b0b327163577585becb5e762536058d21dc1c98
Diffstat (limited to 'glanceclient/v1')
-rw-r--r--glanceclient/v1/images.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/glanceclient/v1/images.py b/glanceclient/v1/images.py
index 4e26c51..14c1921 100644
--- a/glanceclient/v1/images.py
+++ b/glanceclient/v1/images.py
@@ -73,6 +73,11 @@ class ImageManager(base.ManagerWithFind):
meta = {'properties': {}}
safe_decode = encodeutils.safe_decode
for key, value in six.iteritems(headers):
+ # NOTE(flaper87): this is a compatibility fix
+ # for urllib3 >= 1.11. Please, refer to this
+ # bug for more info:
+ # https://bugs.launchpad.net/python-glanceclient/+bug/1487645
+ key = key.lower()
value = safe_decode(value, incoming='utf-8')
if key.startswith('x-image-meta-property-'):
_key = safe_decode(key[22:], incoming='utf-8')