Comment 2 for bug 1034837

Revision history for this message
Jim Baker (jimbaker) wrote :

According to http://docs.openstack.org/api/quick-start/content/index.html#Getting-Credentials-a00665, code using the OpenStack REST API should request a new token upon receiving a 401 status code, then retry.

In the OpenStack provider, for every client request, the `_OpenStackClient.is_authenticated` method is checked to see if a token needs to be first requested. However, as currently implemented, this method will never reset to being False. So solving this bug simply requires ensuring that any 401 status code does in fact do that; something as simple as setting `self.token = None` in the `_empty` and `_json` result processing methods should suffice. (We can also return a better exception too, so as to improve the logging in the provisioning agent, just to indicate this expiration is to be occasionally expected.)

With that change, the provisioning agent will retry as it always does when it encounters provider errors, thus fufilling the requirements of the above link, and thereby fixing this bug.