keystone.users.check_in_group throws exception instead of False

Bug #1543270 reported by Mike Lowe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient
Opinion
Undecided
Unassigned

Bug Description

When calling keystone.users.check_in_group it will return True for status 204 as per the api but throws a keystoneclient.exceptions.NotFound: Not Found (HTTP 404) when it should return false. The api documentation states that a 404 return code means a user is not in a group and does not indicate an error. Briefly reviewing the documentation I think it is safe and expected for BaseManager.head(...) from python-keystoneclient/keystoneclient/openstack/common/apiclient/base.py to return False for a 404 error code. Something like this is more appropriate:

    def _head(self, url):
        """Retrieve request headers for an object.
        :param url: a partial URL, e.g., '/servers'
        """
        try:
           resp = self.client.head(url)
           return resp.status_code == 204
        except keystoneclient.exceptions.NotFound:
            return False

Revision history for this message
Steve Martinelli (stevemar) wrote :

Unfortunately I think this is a backwards incompatible change.

Changed in python-keystoneclient:
status: New → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.