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:
parent
e6404c3d23
commit
43efbf1d5f
@ -110,7 +110,6 @@ class BarbicanKeyManager(key_manager.KeyManager):
|
|||||||
return self._barbican_client
|
return self._barbican_client
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._current_context = context
|
|
||||||
auth = self._get_keystone_auth(context)
|
auth = self._get_keystone_auth(context)
|
||||||
sess = session.Session(auth=auth)
|
sess = session.Session(auth=auth)
|
||||||
|
|
||||||
@ -118,6 +117,7 @@ class BarbicanKeyManager(key_manager.KeyManager):
|
|||||||
self._barbican_client = barbican_client.Client(
|
self._barbican_client = barbican_client.Client(
|
||||||
session=sess,
|
session=sess,
|
||||||
endpoint=self._barbican_endpoint)
|
endpoint=self._barbican_endpoint)
|
||||||
|
self._current_context = context
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.error(u._LE("Error creating Barbican client: %s"), e)
|
LOG.error(u._LE("Error creating Barbican client: %s"), e)
|
||||||
|
Loading…
Reference in New Issue
Block a user