diff --git a/changelogs/fragments/78516-galaxy-cli-exit-codes.yml b/changelogs/fragments/78516-galaxy-cli-exit-codes.yml new file mode 100644 index 00000000000..cdd0cdf3a89 --- /dev/null +++ b/changelogs/fragments/78516-galaxy-cli-exit-codes.yml @@ -0,0 +1,3 @@ +bugfixes: +- ansible-galaxy - Fix exit codes for role search and delete + (https://github.com/ansible/ansible/issues/78516) diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py index 4ab2fe4995d..5acaa6e46ab 100755 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -1671,7 +1671,7 @@ class GalaxyCLI(CLI): if response['count'] == 0: display.display("No roles match your search.", color=C.COLOR_ERROR) - return True + return 1 data = [u''] @@ -1694,7 +1694,7 @@ class GalaxyCLI(CLI): data = u'\n'.join(data) self.pager(data) - return True + return 0 def execute_import(self): """ used to import a role into Ansible Galaxy """ @@ -1800,7 +1800,7 @@ class GalaxyCLI(CLI): display.display(resp['status']) - return True + return 0 def main(args=None):