File 0001-Invalid-output-running-the-command-glance-image-show.patch of Package python-glanceclient.2398

From 2c7da7cb6077b89a7e195f76ed092ea7dfe65e02 Mon Sep 17 00:00:00 2001
From: David Sariel <dsariel@redhat.com>
Date: Wed, 2 Sep 2015 14:48:17 +0300
Subject: [PATCH] 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
---
 glanceclient/v1/images.py | 5 +++++
 1 file changed, 5 insertions(+)

Index: python-glanceclient-0.15.0/glanceclient/v1/images.py
===================================================================
--- python-glanceclient-0.15.0.orig/glanceclient/v1/images.py
+++ python-glanceclient-0.15.0/glanceclient/v1/images.py
@@ -72,6 +72,11 @@ class ImageManager(base.ManagerWithFind)
         meta = {'properties': {}}
         safe_decode = strutils.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')
openSUSE Build Service is sponsored by