summaryrefslogtreecommitdiff
path: root/keystoneclient/access.py
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2013-01-22 17:55:49 +0100
committerJulien Danjou <julien@danjou.info>2013-01-24 18:48:22 +0100
commit7afcea1e66225e1f42f6cde1f29e802cb899da4f (patch)
treeff628fac2cb1317e02c10318de36d643a9599c73 /keystoneclient/access.py
parent3dfb8437fc9135465f2b66b2c420bf20899fcf10 (diff)
downloadpython-keystoneclient-7afcea1e66225e1f42f6cde1f29e802cb899da4f.tar.gz
Fix STALE_TOKEN_DURATION usage
Change-Id: I9856684d93d8b45310e599863553a020180aa509 Signed-off-by: Julien Danjou <julien@danjou.info>
Diffstat (limited to 'keystoneclient/access.py')
-rw-r--r--keystoneclient/access.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/keystoneclient/access.py b/keystoneclient/access.py
index 3947b6f..c16c22b 100644
--- a/keystoneclient/access.py
+++ b/keystoneclient/access.py
@@ -21,7 +21,7 @@ from keystoneclient.openstack.common import timeutils
# gap, in seconds, to determine whether the given token is about to expire
-STALE_TOKEN_DURATION = '30'
+STALE_TOKEN_DURATION = 30
class AccessInfo(dict):
@@ -37,7 +37,8 @@ class AccessInfo(dict):
:return: boolean : true if expiration is within the given duration
"""
- stale_duration = stale_duration or TALE_TOKEN_DURATION
+ stale_duration = (STALE_TOKEN_DURATION if stale_duration is None
+ else stale_duration)
norm_expires = timeutils.normalize_time(self.expires)
# (gyee) should we move auth_token.will_expire_soon() to timeutils
# instead of duplicating code here?