glanceclient/common/utils.py safe_header throws an exception on X-Auth-Token with None value
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance Client |
Fix Released
|
High
|
David Edery |
Bug Description
When using the glance-client with an internally generated admin context (e.g. using nova_context.
An example of a stack trace (coming from RH juno distro's nova.compute.
Traceback (most recent call last):
File "/usr/lib/
*args, **kwargs)
File "/usr/lib/
task_
File "/usr/lib/
update_
File "/usr/lib/
self.
File "/usr/lib/
instance)
File "/usr/lib/
context, self._image_api, image_ref, instance)
File "/usr/lib/
image = image_api.
File "/usr/lib/
include_
File "/usr/lib/
_reraise_
File "/usr/lib/
image = self._client.
File "/usr/lib/
return getattr(
File "/usr/lib/
% urlparse.
File "/usr/lib/
return self._request(
File "/usr/lib/
self.
File "/usr/lib/
header = '-H \'%s: %s\'' % safe_header(key, value)
File "/usr/lib/
v = value.encode(
AttributeError: 'NoneType' object has no attribute 'encode'
Changed in neutron: | |
assignee: | nobody → David Edery (david-edery) |
no longer affects: | neutron |
affects: | glance → python-glanceclient |
Changed in python-glanceclient: | |
status: | New → Fix Committed |
importance: | Undecided → High |
Changed in python-glanceclient: | |
milestone: | none → 1.1.0 |
status: | Fix Committed → Fix Released |
Adding a check for value is not None at the safe_header method solves the issue with no consequences on functionality (on the contrary, if anything, it causes the functionality to succeed due to no exception).