diff options
author | Alessio Ababilov <ilovegnulinux@gmail.com> | 2013-05-19 18:19:56 +0300 |
---|---|---|
committer | Alessio Ababilov <ilovegnulinux@gmail.com> | 2013-05-19 18:21:06 +0300 |
commit | c0ed25ee60cd3237ab11db5f5ce60e4cfea34bf3 (patch) | |
tree | acafbfc8e17f20990035a07ecc6ea946703185a0 | |
parent | f7d3837eae3f4ec2177640e70b2375414ac2c306 (diff) | |
download | python-keystoneclient-c0ed25ee60cd3237ab11db5f5ce60e4cfea34bf3.tar.gz |
Make ManagerWithFind abstract and fix TokenManager
ManagerWithFind requires list() method in its descendants.
Make it abstract and fix its improper descendant TokenManager
that do not implement list().
Change-Id: I83ae47d894c02d5cd1eb0da437dd05796d0b0160
Fixes: bug #1180393
-rw-r--r-- | keystoneclient/base.py | 8 | ||||
-rw-r--r-- | keystoneclient/v2_0/tokens.py | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/keystoneclient/base.py b/keystoneclient/base.py index 712fbdc..c57ee62 100644 --- a/keystoneclient/base.py +++ b/keystoneclient/base.py @@ -18,6 +18,7 @@ Base utilities to build API operation managers and objects on top of. """ +import abc import urllib from keystoneclient import exceptions @@ -116,6 +117,13 @@ class ManagerWithFind(Manager): """ Like a `Manager`, but with additional `find()`/`findall()` methods. """ + + __metaclass__ = abc.ABCMeta + + @abc.abstractmethod + def list(self): + pass + def find(self, **kwargs): """ Find a single item with attributes matching ``**kwargs``. diff --git a/keystoneclient/v2_0/tokens.py b/keystoneclient/v2_0/tokens.py index c129db7..4618b0c 100644 --- a/keystoneclient/v2_0/tokens.py +++ b/keystoneclient/v2_0/tokens.py @@ -18,7 +18,7 @@ class Token(base.Resource): return self._info['token'].get('tenant', None) -class TokenManager(base.ManagerWithFind): +class TokenManager(base.Manager): resource_class = Token def authenticate(self, username=None, tenant_id=None, tenant_name=None, |