Merge "Use cached auth_ref instead of gettin a new one each time"
This commit is contained in:
commit
bc6c123c1c
|
@ -80,8 +80,7 @@ class SwiftConnectionManager(object):
|
|||
# connection manager users. Also we disable re-authentication
|
||||
# if there is not way to execute it (cannot initialize trusts for
|
||||
# multi-tenant or auth_version is not 3)
|
||||
auth_ref = self.client.session.auth.get_auth_ref(
|
||||
self.client.session)
|
||||
auth_ref = self.client.session.auth.auth_ref
|
||||
# if connection token is going to expire soon (keystone checks
|
||||
# is token is going to expire or expired already)
|
||||
if auth_ref.will_expire_soon(
|
||||
|
|
|
@ -107,7 +107,7 @@ class TestConnectionManager(base.StoreBaseTest):
|
|||
self.context)
|
||||
# return the same connection because it should not be expired
|
||||
auth_ref = mock.MagicMock()
|
||||
self.client.session.auth.get_auth_ref.return_value = auth_ref
|
||||
self.client.session.auth.auth_ref = auth_ref
|
||||
auth_ref.will_expire_soon.return_value = False
|
||||
manager.get_connection()
|
||||
# check that we don't update connection
|
||||
|
@ -149,7 +149,7 @@ class TestConnectionManager(base.StoreBaseTest):
|
|||
)
|
||||
# return the same connection because it should not be expired
|
||||
auth_ref = mock.MagicMock()
|
||||
self.client.session.auth.get_auth_ref.return_value = auth_ref
|
||||
self.client.session.auth.auth_ref = auth_ref
|
||||
auth_ref.will_expire_soon.return_value = False
|
||||
manager.get_connection()
|
||||
# check that we don't update connection
|
||||
|
|
Loading…
Reference in New Issue