Skip to content

Commit

Permalink
Fix typo for self.list
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sshnaidm authored and frac committed Mar 14, 2019
1 parent 6ffd1f3 commit 0cd6b28
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mistralclient/api/base.py
Expand Up @@ -74,7 +74,15 @@ def __init__(self, http_client):
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,
Expand Down

0 comments on commit 0cd6b28

Please sign in to comment.