poor exception handling creates inaccurate user facing error messages
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-keystoneclient |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Keystone client has an anti-pattern throughout it: it catches exceptions, ignores them and then warns or rethrows a different exception.
Here is an example of the impact of this bad practice:
$ glance image-list
Authorization Failed: <attribute 'message' of 'exceptions.
# but I can talk to keystone just fine:
[EXIT 1] $ keystone endpoint-list
+--
| id | region | publicurl | internalurl | adminurl | service_id |
+--
| 2782708b08ac4cb
| 2f7ddb958ce7483
| 9f44982d617e41c
| ad6cf1833b304c2
+--
So, I removed this try/except in the request method in keystoneclient/
try:
resp = requests.request(
except requests.
msg = 'Unable to establish connection to %s' % url
raise exceptions.
And I got a better error message:
$ glance image-list
Authorization Failed: [Errno 1] _ssl.c:490: error:14090086:SSL routines:
There are other examples of this in keystone client such as in _validate_
Changed in python-keystoneclient: | |
status: | New → Confirmed |
Changed in python-keystoneclient: | |
importance: | Undecided → Medium |
Changed in python-keystoneclient: | |
assignee: | nobody → Jorge Edgar Valderrama Romero (jorge-valderrama) |
Changed in python-keystoneclient: | |
assignee: | nobody → Victor Howard (victor-r-howard) |
Changed in python-keystoneclient: | |
assignee: | Victor Howard (victor-r-howard) → nobody |
Changed in python-keystoneclient: | |
assignee: | nobody → Aleksey Nakoryakov (alfnak) |
Unassigning due to inactivity.