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
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
Base utilities to build API operation managers and objects on top of.
|
Base utilities to build API operation managers and objects on top of.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import abc
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
@@ -116,6 +117,13 @@ class ManagerWithFind(Manager):
|
|||||||
"""
|
"""
|
||||||
Like a `Manager`, but with additional `find()`/`findall()` methods.
|
Like a `Manager`, but with additional `find()`/`findall()` methods.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
__metaclass__ = abc.ABCMeta
|
||||||
|
|
||||||
|
@abc.abstractmethod
|
||||||
|
def list(self):
|
||||||
|
pass
|
||||||
|
|
||||||
def find(self, **kwargs):
|
def find(self, **kwargs):
|
||||||
"""
|
"""
|
||||||
Find a single item with attributes matching ``**kwargs``.
|
Find a single item with attributes matching ``**kwargs``.
|
||||||
|
@@ -18,7 +18,7 @@ class Token(base.Resource):
|
|||||||
return self._info['token'].get('tenant', None)
|
return self._info['token'].get('tenant', None)
|
||||||
|
|
||||||
|
|
||||||
class TokenManager(base.ManagerWithFind):
|
class TokenManager(base.Manager):
|
||||||
resource_class = Token
|
resource_class = Token
|
||||||
|
|
||||||
def authenticate(self, username=None, tenant_id=None, tenant_name=None,
|
def authenticate(self, username=None, tenant_id=None, tenant_name=None,
|
||||||
|
Reference in New Issue
Block a user