diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-02-27 15:20:42 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-02-27 15:20:42 +0000 |
| commit | 7d57eceb19aaaca8de84a8701552715fc8153872 (patch) | |
| tree | 53d4ba05227b1ccc82c779e0a7545964f323184a /keystoneclient/base.py | |
| parent | eecfce283f272243e4b957ad9ec7c4fdfbcf12de (diff) | |
| parent | b4b168bdbf9554bae0faf77354b5d592f98e6846 (diff) | |
| download | python-keystoneclient-2.3.1.tar.gz | |
Merge "Revert "Support `truncated` flag returned by identity service""2.3.1
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. |
