Skip to content

Commit

Permalink
modules/xbps: fix error message (#4438)
Browse files Browse the repository at this point in the history
The previous error message was not giving the full or even correct
information to the user.

(cherry picked from commit d3adde4)
  • Loading branch information
CameronNemo authored and patchback[bot] committed Apr 11, 2022
1 parent 24b5530 commit a628045
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/4438-fix-error-message.yaml
Original file line number Diff line number Diff line change
@@ -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).
4 changes: 3 additions & 1 deletion plugins/modules/packaging/os/xbps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit a628045

Please sign in to comment.