Fix typo for self.list

Mistake was introduced in https://review.openstack.org/#/c/554950
Added an abstract method list to the base ResourceManager that
raises a notImplementedError if called (instead of using
abc.abstractmethod that would force the implementation of a list
method that might not be required for all resources)

Closes-Bug: #1820045

Change-Id: I0c69e1beeb452a95cc5988a462f733806afbfafc
(cherry picked from commit 0cd6b28292)
This commit is contained in:
Sagi Shnaidman
2019-03-14 13:52:53 +02:00
committed by Dougal Matthews
parent ac6de6cf29
commit 0b52bfc161

View File

@@ -74,7 +74,15 @@ class ResourceManager(object):
self.http_client = http_client
def find(self, **kwargs):
return [i for i in self._list() if _check_items(i, kwargs.items())]
return [i for i in self.list() if _check_items(i, kwargs.items())]
def list(self):
"""This is an abstract method
This is added here so that the find method gains some clarity.
It must be implemented by the child class in order to find to work
"""
raise NotImplementedError("abstract method list must be implemented")
@staticmethod
def _build_query_params(marker=None, limit=None, sort_keys=None,