diff options
author | Julien Danjou <julien@danjou.info> | 2013-01-24 17:46:29 +0100 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2013-06-11 10:00:13 +0200 |
commit | a56ce5817f814531151b2c4bc6da78f4c2b0ed02 (patch) | |
tree | 42a0362ac38558933fcaede55e81b6295f2e62f1 /keystoneclient/access.py | |
parent | 2ec2e7ee31a9a7305d524bceaf2c10f89ef27f02 (diff) | |
download | python-keystoneclient-a56ce5817f814531151b2c4bc6da78f4c2b0ed02.tar.gz |
Use AuthRef for some client fields
This tackles some TODO items left over.
Change-Id: Ib062744acbf56f05d09857d244b78b35c0ef4d39
Signed-off-by: Julien Danjou <julien@danjou.info>
Diffstat (limited to 'keystoneclient/access.py')
-rw-r--r-- | keystoneclient/access.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/keystoneclient/access.py b/keystoneclient/access.py index 1dc8670..346315f 100644 --- a/keystoneclient/access.py +++ b/keystoneclient/access.py @@ -18,7 +18,7 @@ import datetime from keystoneclient.openstack.common import timeutils - +from keystoneclient import service_catalog # gap, in seconds, to determine whether the given token is about to expire STALE_TOKEN_DURATION = 30 @@ -28,6 +28,14 @@ class AccessInfo(dict): """An object for encapsulating a raw authentication token from keystone and helper methods for extracting useful values from that token.""" + def __init__(self, *args, **kwargs): + super(AccessInfo, self).__init__(*args, **kwargs) + self.service_catalog = service_catalog.ServiceCatalog( + resource_dict=self, region_name=self.get('region_name')) + + def has_service_catalog(self): + return 'serviceCatalog' in self + def will_expire_soon(self, stale_duration=None): """ Determines if expiration is about to occur. |