diff --git a/hcloud/core/client.py b/hcloud/core/client.py index b0bde8c1..ec866620 100644 --- a/hcloud/core/client.py +++ b/hcloud/core/client.py @@ -12,20 +12,15 @@ def __init__(self, client): """ self._client = client - def _get_all( - self, - list_function, # type: function - *args, - **kwargs, - ): - # type (...) -> List[BoundModelBase] + def get_all(self, *args, **kwargs): + # type: (...) -> List[BoundModelBase] results = [] page = 1 while page: # The *PageResult tuples MUST have the following structure # `(result: List[Bound*], meta: Meta)` - result, meta = list_function( + result, meta = self.get_list( page=page, per_page=self.max_per_page, *args, **kwargs ) if result: @@ -43,10 +38,6 @@ def _get_all( return results - def get_all(self, *args, **kwargs): - # type: (...) -> List[BoundModelBase] - return self._get_all(self.get_list, *args, **kwargs) - def get_actions(self, *args, **kwargs): # type: (...) -> List[BoundModelBase] if not hasattr(self, "get_actions_list"):