diff options
author | Monty Taylor <mordred@inaugust.com> | 2016-02-26 21:39:00 +0000 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2016-02-26 21:39:00 +0000 |
commit | b4b168bdbf9554bae0faf77354b5d592f98e6846 (patch) | |
tree | 9e37694fbd462f5d4f5ce78be4655cb0d23a5be3 /keystoneclient/base.py | |
parent | 870be44c0ed5564101f9cf9d53e8085fb01680c8 (diff) | |
download | python-keystoneclient-b4b168bdbf9554bae0faf77354b5d592f98e6846.tar.gz |
Revert "Support `truncated` flag returned by identity service"
This reverts commit 870be44c0ed5564101f9cf9d53e8085fb01680c8.
This change breaks end users of the library. See:
http://logs.openstack.org/50/285450/1/check/gate-shade-dsvm-functional-keystone2/d1093b5/console.html#_2016-02-26_20_49_32_928
For an example of a consumer of the library being broken.
Change-Id: I1912003afb89579eb869767db7a411c451bc9806
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. |