mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #14712 from chouseknecht/galaxy2_paging
Fix bug 14715: Galaxy CLI paging error
This commit is contained in:
commit
0d1138e0a0
1 changed files with 6 additions and 6 deletions
|
@ -180,12 +180,12 @@ class GalaxyAPI(object):
|
||||||
url = '%s/roles/%d/%s/?page_size=50' % (self.baseurl, int(role_id), related)
|
url = '%s/roles/%d/%s/?page_size=50' % (self.baseurl, int(role_id), related)
|
||||||
data = self.__call_galaxy(url)
|
data = self.__call_galaxy(url)
|
||||||
results = data['results']
|
results = data['results']
|
||||||
done = (data.get('next', None) is None)
|
done = (data.get('next_link', None) is None)
|
||||||
while not done:
|
while not done:
|
||||||
url = '%s%s' % (self.baseurl, data['next'])
|
url = '%s%s' % (self._api_server, data['next_link'])
|
||||||
data = self.__call_galaxy(url)
|
data = self.__call_galaxy(url)
|
||||||
results += data['results']
|
results += data['results']
|
||||||
done = (data.get('next', None) is None)
|
done = (data.get('next_link', None) is None)
|
||||||
return results
|
return results
|
||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
|
@ -203,12 +203,12 @@ class GalaxyAPI(object):
|
||||||
results = data
|
results = data
|
||||||
done = True
|
done = True
|
||||||
if "next" in data:
|
if "next" in data:
|
||||||
done = (data.get('next', None) is None)
|
done = (data.get('next_link', None) is None)
|
||||||
while not done:
|
while not done:
|
||||||
url = '%s%s' % (self.baseurl, data['next'])
|
url = '%s%s' % (self._api_server, data['next_link'])
|
||||||
data = self.__call_galaxy(url)
|
data = self.__call_galaxy(url)
|
||||||
results += data['results']
|
results += data['results']
|
||||||
done = (data.get('next', None) is None)
|
done = (data.get('next_link', None) is None)
|
||||||
return results
|
return results
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
raise AnsibleError("Failed to download the %s list: %s" % (what, str(error)))
|
raise AnsibleError("Failed to download the %s list: %s" % (what, str(error)))
|
||||||
|
|
Loading…
Reference in a new issue