diff options
author | Brian Coca <bcoca@ansible.com> | 2016-02-29 22:43:47 -0500 |
---|---|---|
committer | Brian Coca <bcoca@ansible.com> | 2016-02-29 22:43:47 -0500 |
commit | d2bd6604b0e5611d43e0da991af6b624f038a03d (patch) | |
tree | 844da850b48ce08dc8b67bc0d9255a10b76923ed | |
parent | ca98e742516fa79203f9667f823ca7745a2d8a42 (diff) | |
parent | 41d6531fe7fb521903aa6a91bbc9d95c60fed66f (diff) | |
download | ansible-d2bd6604b0e5611d43e0da991af6b624f038a03d.tar.gz |
Merge pull request #14713 from chouseknecht/galaxy1.9_paging
Fix bug 14715: Galaxy CLI paging error
-rwxr-xr-x | bin/ansible-galaxy | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/ansible-galaxy b/bin/ansible-galaxy index a269ce7a8a..565dd89f59 100755 --- a/bin/ansible-galaxy +++ b/bin/ansible-galaxy @@ -312,13 +312,13 @@ def api_fetch_role_related(api_server, related, role_id, ignore_certs=False): url = 'https://%s/api/v1/roles/%d/%s/?page_size=50' % (api_server, int(role_id), related) data = json.load(open_url(url, validate_certs=validate_certs)) results = data['results'] - done = (data.get('next', None) == None) + done = (data.get('next_link', None) == None) while not done: - url = 'https://%s%s' % (api_server, data['next']) + url = 'https://%s%s' % (api_server, data['next_link']) print url data = json.load(open_url(url)) results += data['results'] - done = (data.get('next', None) == None) + done = (data.get('next_link', None) == None) return results except: return None @@ -340,14 +340,14 @@ def api_get_list(api_server, what, ignore_certs=False): else: results = data done = True - if "next" in data: - done = (data.get('next', None) == None) + if "next_link" in data: + done = (data.get('next_link', None) == None) while not done: - url = 'https://%s%s' % (api_server, data['next']) + url = 'https://%s%s' % (api_server, data['next_link']) print url data = json.load(open_url(url)) results += data['results'] - done = (data.get('next', None) == None) + done = (data.get('next_link', None) == None) return results except: print "- failed to download the %s list" % what |