Missing guard checks in _get_cpid_from_keystone allow cpid to be None

Bug #1502949 reported by Daryl Walleck
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
refstack
Fix Released
Medium
David Liu

Bug Description

In refstack-client, the _get_cpid_from_keystone method should always return the service id. However, the case where the identity endpoint is not found in the catalog is not handled (this is happening right now with Rackspace's public cloud). If the identity endpoint is not found, there is not a guard check in place (https://github.com/openstack/refstack-client/blob/master/refstack_client/refstack_client.py#L168, https://github.com/openstack/refstack-client/blob/master/refstack_client/refstack_client.py#L153) to handle this case, probably with an else clause to the for loops.
At the least we should provide a warning log entry that the cpid could not be retrieved. It might also make sense to exit with an error at this point as well.

Catherine Diep (cdiep)
Changed in refstack:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Catherine Diep (cdiep) wrote :

Confirm that RefStack should handle the error case where catalog information returned does not include identity endpoint/service IDs.

Catherine Diep (cdiep)
Changed in refstack:
assignee: nobody → david liu (lzbj)
David Liu (lzbj)
Changed in refstack:
status: Confirmed → In Progress
Revision history for this message
David Paterson (davpat2112) wrote :

This change is broken unless the first service['type'] == 'identity'. If the first service type is 'volume' for instance, we raise exception and exit loop, never reaching the identity service. We should add unit tests.

Breaks here:
 for service in token['catalog']:
    if service['type'] == 'identity' and \
     'id' in service and service['id'] is not None:
         return service['id']
     else:
         message = "Unable to retrive CPID. " + \
             "Identity service ID was not " + \
             "found in Keystone v3 catalog."
         self.logger.error(message)
         raise RuntimeError(message)

Revision history for this message
David Liu (lzbj) wrote :

Thank you, I'll add another bug for it. https://bugs.launchpad.net/refstack/+bug/1515880

Revision history for this message
Catherine Diep (cdiep) wrote :

David, Thank you for your quick identification of the issue ... A fix was submitted with https://review.openstack.org/#/c/245007/ . .. We would really appreciate your review ... Thanks again!

Revision history for this message
Catherine Diep (cdiep) wrote :

This bug is fixed with https://review.openstack.org/#/c/245007/ merged on November 18, 2015

Changed in refstack:
status: In Progress → Fix Committed
Catherine Diep (cdiep)
Changed in refstack:
status: Fix Committed → Fix Released
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.