]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Unset auth token before trying to login to Datera
authorMike Perez <thingee@gmail.com>
Wed, 11 Mar 2015 19:27:32 +0000 (12:27 -0700)
committerMike Perez <thingee@gmail.com>
Wed, 11 Mar 2015 19:35:01 +0000 (12:35 -0700)
After a token expires, the Datera driver would try to login, and pass
along the expired token. This would fail because the receiving server
will authorize anytime it's given an auth token, even for endpoints that
don't require it. This change unsets the auth token when logging in, so
it's not passed a long.

Closes-Bug: #1430978
Change-Id: Id445718e3e73b676e3af8005b8fdd1a028ef2b0e

cinder/volume/drivers/datera.py

index f556afcc50af745d08564f0867a0d44ba6d64977..47d6a6d50c39b99e3dc62cf94c75360b6727408d 100644 (file)
@@ -258,6 +258,10 @@ class DateraDriver(san.SanISCSIDriver):
             'password': self.password
         }
 
+        # Unset token now, otherwise potential expired token will be sent
+        # along to be used for authorization when trying to login.
+        self.auth_token = None
+
         try:
             LOG.debug('Getting Datera auth token.')
             results = self._issue_api_request('login', 'post', body=data,