Skip to content

Commit b2d465f

Browse files
committed
Pass timeout to the ksa session too.
For whatever reason the timeout isn't passed on here. I can't think of any reason to not use the timeout here too. Closes: https://bugs.launchpad.net/python-swiftclient/+bug/2126931 Change-Id: Ife99b3bd6610de92233907c9eaf9fa9295cdef2b Signed-off-by: David Svenson <davidsvenson@outlook.com>
1 parent ca397b1 commit b2d465f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

swiftclient/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ def get_auth_keystone(auth_url, user, key, os_options, **kwargs):
601601
'application_credential_secret'),
602602
application_credential_id=os_options.get(
603603
'application_credential_id'))
604-
sess = ksa_session.Session(auth=auth)
604+
sess = ksa_session.Session(auth=auth, timeout=timeout)
605605
token = sess.get_token()
606606
except ksauthexceptions.Unauthorized:
607607
msg = 'Unauthorized. Check application credential id and secret.'

test/unit/test_swiftclient.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,11 @@ class FakeEndpointData:
594594

595595
class FakeKeystoneuth1v3Session:
596596

597-
def __init__(self, auth):
597+
def __init__(self, auth, timeout=None):
598598
self.auth = auth
599+
self.timeout = None
600+
if timeout is not None:
601+
self.timeout = float(timeout)
599602
self.token = 'token'
600603

601604
def get_token(self):

0 commit comments

Comments
 (0)