When checking whether a given user is in a given group, keystone will
return a 404 Not Found if all went well but the user was not in the
group. It may also return a 403 if the user and the group are in
different backends, which would also mean that the user was not in the
group[1]. Any other 400 response is a client error and any 500 response
is a server error to which the user should be alerted.
Without this patch, openstackclient treats any exception as a valid "not
found" and may end up hiding server errors. This patch reduces the
caught exceptions to 403 and 404 responses and treats everything else as
an error.
Reviewed: https:/ /review. openstack. org/445257 /git.openstack. org/cgit/ openstack/ python- openstackclient /commit/ ?id=853ea5ab59e 5d7845d389e4652 7038575c3c170c
Committed: https:/
Submitter: Jenkins
Branch: master
commit 853ea5ab59e5d78 45d389e46527038 575c3c170c
Author: Colleen Murphy <email address hidden>
Date: Tue Mar 14 01:24:31 2017 +0100
Narrow expected responses for CheckUserInGroup
When checking whether a given user is in a given group, keystone will
return a 404 Not Found if all went well but the user was not in the
group. It may also return a 403 if the user and the group are in
different backends, which would also mean that the user was not in the
group[1]. Any other 400 response is a client error and any 500 response
is a server error to which the user should be alerted.
Without this patch, openstackclient treats any exception as a valid "not
found" and may end up hiding server errors. This patch reduces the
caught exceptions to 403 and 404 responses and treats everything else as
an error.
[1] https:/ /developer. openstack. org/api- ref/identity/ v3/?expanded= check-whether- user-belongs- to-group- detail# check-whether- user-belongs- to-group
Closes-bug: #1672634
Change-Id: Id3f3b2409b7cee 480ee3c19b6d6c3 070599ffe8f