|
|
@ -28,7 +28,7 @@ from ansible import context
|
|
|
|
from ansible.cli.arguments import option_helpers as opt_help
|
|
|
|
from ansible.cli.arguments import option_helpers as opt_help
|
|
|
|
from ansible.errors import AnsibleError, AnsibleOptionsError
|
|
|
|
from ansible.errors import AnsibleError, AnsibleOptionsError
|
|
|
|
from ansible.galaxy import Galaxy, get_collections_galaxy_meta_info
|
|
|
|
from ansible.galaxy import Galaxy, get_collections_galaxy_meta_info
|
|
|
|
from ansible.galaxy.api import GalaxyAPI
|
|
|
|
from ansible.galaxy.api import GalaxyAPI, GalaxyError
|
|
|
|
from ansible.galaxy.collection import (
|
|
|
|
from ansible.galaxy.collection import (
|
|
|
|
build_collection,
|
|
|
|
build_collection,
|
|
|
|
download_collections,
|
|
|
|
download_collections,
|
|
|
@ -1220,7 +1220,7 @@ class GalaxyCLI(CLI):
|
|
|
|
remote_data = None
|
|
|
|
remote_data = None
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
remote_data = self.api.lookup_role_by_name(role, False)
|
|
|
|
remote_data = self.api.lookup_role_by_name(role, False)
|
|
|
|
except AnsibleError as e:
|
|
|
|
except GalaxyError as e:
|
|
|
|
if e.http_code == 400 and 'Bad Request' in e.message:
|
|
|
|
if e.http_code == 400 and 'Bad Request' in e.message:
|
|
|
|
# Role does not exist in Ansible Galaxy
|
|
|
|
# Role does not exist in Ansible Galaxy
|
|
|
|
data = u"- the role %s was not found" % role
|
|
|
|
data = u"- the role %s was not found" % role
|
|
|
|