From 0cd6b282920214d2995d1203aa0ad7d33c825b10 Mon Sep 17 00:00:00 2001 From: Sagi Shnaidman Date: Thu, 14 Mar 2019 13:52:53 +0200 Subject: [PATCH] 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 --- mistralclient/api/base.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mistralclient/api/base.py b/mistralclient/api/base.py index fd6fbbcd..5bda3188 100644 --- a/mistralclient/api/base.py +++ b/mistralclient/api/base.py @@ -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,