Skip to content

Commit

Permalink
pacman: do not fail if there is nothing to do (#8514)
Browse files Browse the repository at this point in the history
Do not fail if there is nothing to do.

(cherry picked from commit df7fe19)
  • Loading branch information
felixfontein authored and patchback[bot] committed Jun 17, 2024
1 parent e9f0e49 commit 6941838
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/8514-pacman-empty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "paman - do not fail if an empty list of packages has been provided and there is nothing to do (https://github.com/ansible-collections/community.general/pull/8514)."
5 changes: 3 additions & 2 deletions plugins/modules/pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ def run(self):
self.install_packages(pkgs)
self.success()

# This shouldn't happen...
self.fail("This is a bug")
# This happens if an empty list has been provided for name
self.add_exit_infos(msg='Nothing to do')
self.success()

def install_packages(self, pkgs):
pkgs_to_install = []
Expand Down

0 comments on commit 6941838

Please sign in to comment.