summaryrefslogtreecommitdiff
path: root/glanceclient/common/http.py
diff options
context:
space:
mode:
authorIan Cordasco <ian.cordasco@rackspace.com>2015-02-02 09:39:15 -0600
committerIan Cordasco <ian.cordasco@rackspace.com>2015-02-03 13:22:44 -0600
commitdb743e363544d2064107cbaedcf2f5fda4683b8a (patch)
tree6982a4a965a22ed5e9cd5f04d2ee0ea09f8e5066 /glanceclient/common/http.py
parent5ec4a24b895d3feecd68bca4e14eb47b11e1981b (diff)
downloadpython-glanceclient-db743e363544d2064107cbaedcf2f5fda4683b8a.tar.gz
Ignore NoneType when encoding headers
Some generated header values may in fact be None. Trying to encode None causes the client to fail with an exception and cannot be worked around by the user. Change-Id: I638b1fba0ef9a07d726445d8c2cdd774140f5b83 Closes-bug: 1415935
Diffstat (limited to 'glanceclient/common/http.py')
-rw-r--r--glanceclient/common/http.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py
index e867ac2..40a39cb 100644
--- a/glanceclient/common/http.py
+++ b/glanceclient/common/http.py
@@ -147,7 +147,7 @@ class HTTPClient(object):
names and values
"""
return dict((encodeutils.safe_encode(h), encodeutils.safe_encode(v))
- for h, v in six.iteritems(headers))
+ for h, v in six.iteritems(headers) if v is not None)
def _request(self, method, url, **kwargs):
"""Send an http request with the specified characteristics.