summaryrefslogtreecommitdiff
path: root/lib/ansible/galaxy/api.py
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2019-07-17 12:35:24 -0400
committerGitHub <noreply@github.com>2019-07-17 12:35:24 -0400
commitc2253c8133e6b0e97c456ef38ad27b13d65fac4d (patch)
tree4eed6938d065fe771a58007bcc4cd523cc70b69d /lib/ansible/galaxy/api.py
parent4ef2545eb5d661566e06629015967c2d1b8924e3 (diff)
downloadansible-c2253c8133e6b0e97c456ef38ad27b13d65fac4d.tar.gz
Allow for no role_versions to be present (#56519)
* Allow for no role_versions to be present fixes #46650 better info on fetch, ensure list return * use correct to_
Diffstat (limited to 'lib/ansible/galaxy/api.py')
-rw-r--r--lib/ansible/galaxy/api.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ansible/galaxy/api.py b/lib/ansible/galaxy/api.py
index 55e46c44f7..d029821735 100644
--- a/lib/ansible/galaxy/api.py
+++ b/lib/ansible/galaxy/api.py
@@ -200,6 +200,7 @@ class GalaxyAPI(object):
The url comes from the 'related' field of the role.
"""
+ results = []
try:
url = '%s/roles/%s/%s/?page_size=50' % (self.baseurl, role_id, related)
data = self.__call_galaxy(url)
@@ -210,9 +211,9 @@ class GalaxyAPI(object):
data = self.__call_galaxy(url)
results += data['results']
done = (data.get('next_link', None) is None)
- return results
- except Exception:
- return None
+ except Exception as e:
+ display.vvvv("Unable to retrive role (id=%s) data (%s), but this is not fatal so we continue: %s" % (role_id, related, to_text(e)))
+ return results
@g_connect
def get_list(self, what):