From 527893cb61cd5b1fb0c5eff0fc0d635d99337398 Mon Sep 17 00:00:00 2001 From: s-hertel <19572925+s-hertel@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:14:34 -0400 Subject: [PATCH 1/2] Fix reporting role as not found when remote_data is None --- lib/ansible/cli/galaxy.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py index e3b0b1703f4b3d..65dd8aa4ff69a1 100755 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -1265,6 +1265,9 @@ def execute_info(self): if remote_data: role_info.update(remote_data) + else: + data = u"- the role %s was not found" % role + break elif context.CLIARGS['offline'] and not gr._exists: data = u"- the role %s was not found" % role From f000e6f5725f89c1cce4ba64aaa490132465a3df Mon Sep 17 00:00:00 2001 From: s-hertel <19572925+s-hertel@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:35:02 -0400 Subject: [PATCH 2/2] changelog --- changelogs/fragments/fix-ansible-galaxy-info-no-role-found.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/fix-ansible-galaxy-info-no-role-found.yml diff --git a/changelogs/fragments/fix-ansible-galaxy-info-no-role-found.yml b/changelogs/fragments/fix-ansible-galaxy-info-no-role-found.yml new file mode 100644 index 00000000000000..96c1ef7a0f4c44 --- /dev/null +++ b/changelogs/fragments/fix-ansible-galaxy-info-no-role-found.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-galaxy info - fix reporting no role found when lookup_role_by_name returns None.