This change adds a small workaround in exc.py to avoid a situation
where an HTTP response that has a content-type of 'text/*' but
no text attribute will trigger an AttributeError exception in
the openstack.common.apiclient.exceptions module.
Added a test to make sure the ironic client throws an 'Unauthorized'
exception when it encounters a 401 Unauthorized HTTP response instead
of the observed behavior of throwing an inappropriate AttributeError
exception.
The workaround mentioned above corrects the tested behavior.
Reviewed: https:/ /review. openstack. org/142204 /git.openstack. org/cgit/ openstack/ python- ironicclient/ commit/ ?id=4017ae76888 c3b0a61df9ecacd 15d89f039a95b6
Committed: https:/
Submitter: Jenkins
Branch: master
commit 4017ae76888c3b0 a61df9ecacd15d8 9f039a95b6
Author: Clif Houck <email address hidden>
Date: Tue Dec 16 19:30:56 2014 +0000
Fix to properly issue an Unauthorized exception
This change adds a small workaround in exc.py to avoid a situation common. apiclient. exceptions module.
where an HTTP response that has a content-type of 'text/*' but
no text attribute will trigger an AttributeError exception in
the openstack.
Added a test to make sure the ironic client throws an 'Unauthorized'
exception when it encounters a 401 Unauthorized HTTP response instead
of the observed behavior of throwing an inappropriate AttributeError
exception.
The workaround mentioned above corrects the tested behavior.
Change-Id: I930fd61a896f62 a2984cca1e4d40e 5d89644aa3f
Partial-Bug: #1402840