From d3adde473906491df485729b647315d56d5e5749 Mon Sep 17 00:00:00 2001 From: Cameron Nemo Date: Sun, 10 Apr 2022 22:05:04 -0700 Subject: [PATCH] modules/xbps: fix error message (#4438) The previous error message was not giving the full or even correct information to the user. --- changelogs/fragments/4438-fix-error-message.yaml | 2 ++ plugins/modules/packaging/os/xbps.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/4438-fix-error-message.yaml diff --git a/changelogs/fragments/4438-fix-error-message.yaml b/changelogs/fragments/4438-fix-error-message.yaml new file mode 100644 index 0000000000..67c7050218 --- /dev/null +++ b/changelogs/fragments/4438-fix-error-message.yaml @@ -0,0 +1,2 @@ +bugfixes: + - xbps - fix error message that is reported when installing packages fails (https://github.com/ansible-collections/community.general/pull/4438). diff --git a/plugins/modules/packaging/os/xbps.py b/plugins/modules/packaging/os/xbps.py index 8d314ea859..74a8951b36 100644 --- a/plugins/modules/packaging/os/xbps.py +++ b/plugins/modules/packaging/os/xbps.py @@ -230,7 +230,9 @@ def install_packages(module, xbps_path, state, packages): module.params['upgrade_xbps'] = False install_packages(module, xbps_path, state, packages) elif rc != 0 and not (state == 'latest' and rc == 17): - module.fail_json(msg="failed to install %s" % (package)) + module.fail_json(msg="failed to install %s packages(s)" + % (len(toInstall)), + packages=toInstall) module.exit_json(changed=True, msg="installed %s package(s)" % (len(toInstall)),