Move line of code to ensure context and client stay in sync

If the barbican_client.Client() throws an exception, then
self._current_context will not match self._barbican_client.
This fix moves a line of code down to ensure they will match.

Change-Id: I4e6291d98d9b2d37b3d5063b9b20fbb093d254d4
Closes-bug: #1523646
This commit is contained in:
Dave McCowan 2015-12-09 10:37:24 -05:00
parent e6404c3d23
commit 43efbf1d5f
1 changed files with 1 additions and 1 deletions

View File

@ -110,7 +110,6 @@ class BarbicanKeyManager(key_manager.KeyManager):
return self._barbican_client
try:
self._current_context = context
auth = self._get_keystone_auth(context)
sess = session.Session(auth=auth)
@ -118,6 +117,7 @@ class BarbicanKeyManager(key_manager.KeyManager):
self._barbican_client = barbican_client.Client(
session=sess,
endpoint=self._barbican_endpoint)
self._current_context = context
except Exception as e:
LOG.error(u._LE("Error creating Barbican client: %s"), e)