diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-01-26 17:32:13 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-01-26 17:32:13 +0000 |
commit | 1cbda90717f07cb5197224ee389efa7817f9388c (patch) | |
tree | 1939186b6dbee72d284d05b67624a0fb371cd576 /keystoneclient/access.py | |
parent | 9392732a3fa00febaa90b6ad64631e1d1613e18d (diff) | |
parent | 7afcea1e66225e1f42f6cde1f29e802cb899da4f (diff) | |
download | python-keystoneclient-1cbda90717f07cb5197224ee389efa7817f9388c.tar.gz |
Merge "Fix STALE_TOKEN_DURATION usage"
Diffstat (limited to 'keystoneclient/access.py')
-rw-r--r-- | keystoneclient/access.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/keystoneclient/access.py b/keystoneclient/access.py index 8346358..e552c18 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): @@ -34,7 +34,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? |