From 471863581114a5cabc50392f17033ed04a79f37d Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 26 Sep 2013 11:42:16 -0400 Subject: [PATCH] Fix default value for a header This code specified None as the default value, but it would raise an exception if that was ever returned. An empty string causes the code to work as intended. This came up while I was writing a unit test for another bug fix. Change-Id: I658bb8a9b5124f281988fb60b645182ea0ccf99f Related-bug: #1231524 --- glanceclient/common/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py index 4cd66ec..dfd746d 100644 --- a/glanceclient/common/http.py +++ b/glanceclient/common/http.py @@ -248,7 +248,7 @@ class HTTPClient(object): resp, body_iter = self._http_request(url, method, **kwargs) - if 'application/json' in resp.getheader('content-type', None): + if 'application/json' in resp.getheader('content-type', ''): body = ''.join([chunk for chunk in body_iter]) try: body = json.loads(body)