diff options
Diffstat (limited to 'keystoneclient/base.py')
| -rw-r--r-- | keystoneclient/base.py | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/keystoneclient/base.py b/keystoneclient/base.py index d4fdc9e..3273ecb 100644 --- a/keystoneclient/base.py +++ b/keystoneclient/base.py @@ -76,36 +76,6 @@ def filter_kwargs(f): return func -class TruncatedList(list): - """List with attribute `truncated`. - - The main purpose of this class is to handle flag `truncated` returned - by Identity Service. It subclasses standard Python list and overrides - only equality operators. - - :param bool truncated: whether the list is truncated or not. - """ - def __init__(self, collection, truncated=False): - super(TruncatedList, self).__init__(collection) - self.truncated = truncated - - def __eq__(self, other): - """Compare this list with another one. - - Two TruncatedLists are equal if the lists they carry are equal - and their attributes `truncated` are equal. - - If another value has not attribute `truncated`, it is assumed to - be False. - """ - values_eq = super(TruncatedList, self).__eq__(other) - truncated_eq = self.truncated == getattr(other, 'truncated', False) - return values_eq and truncated_eq - - def __ne__(self, other): - return not self.__eq__(other) - - class Manager(object): """Basic manager type providing common operations. @@ -147,8 +117,6 @@ class Manager(object): :param body: data that will be encoded as JSON and passed in POST request (GET will be sent by default) :param kwargs: Additional arguments will be passed to the request. - :returns: list of objects with indication of truncation - :rtype: :py:class:`keystoneclient.base.TruncatedList` """ if body: resp, body = self.client.post(url, body=body, **kwargs) @@ -159,7 +127,6 @@ class Manager(object): obj_class = self.resource_class data = body[response_key] - truncated = body.get('truncated', False) # NOTE(ja): keystone returns values as list as {'values': [ ... ]} # unlike other services which just return the list... try: @@ -167,8 +134,7 @@ class Manager(object): except (KeyError, TypeError): pass - objects = [obj_class(self, res, loaded=True) for res in data if res] - return TruncatedList(objects, truncated=truncated) + return [obj_class(self, res, loaded=True) for res in data if res] def _get(self, url, response_key, **kwargs): """Get an object from collection. |
