From 42b2077c936dfdce8120ae8430c031a931908ffb Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Mon, 29 Feb 2016 19:24:56 -0500 Subject: [PATCH] Fix bug 14715: Galaxy CLI paging error --- lib/ansible/galaxy/api.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ansible/galaxy/api.py b/lib/ansible/galaxy/api.py index eec9ee932e..3ea51f2891 100644 --- a/lib/ansible/galaxy/api.py +++ b/lib/ansible/galaxy/api.py @@ -180,12 +180,12 @@ class GalaxyAPI(object): url = '%s/roles/%d/%s/?page_size=50' % (self.baseurl, int(role_id), related) data = self.__call_galaxy(url) results = data['results'] - done = (data.get('next', None) is None) + done = (data.get('next_link', None) is None) while not done: - url = '%s%s' % (self.baseurl, data['next']) + url = '%s%s' % (self._api_server, data['next_link']) data = self.__call_galaxy(url) results += data['results'] - done = (data.get('next', None) is None) + done = (data.get('next_link', None) is None) return results except: return None @@ -203,12 +203,12 @@ class GalaxyAPI(object): results = data done = True if "next" in data: - done = (data.get('next', None) is None) + done = (data.get('next_link', None) is None) while not done: - url = '%s%s' % (self.baseurl, data['next']) + url = '%s%s' % (self._api_server, data['next_link']) data = self.__call_galaxy(url) results += data['results'] - done = (data.get('next', None) is None) + done = (data.get('next_link', None) is None) return results except Exception as error: raise AnsibleError("Failed to download the %s list: %s" % (what, str(error)))