From 5e0a60cda6114ef6445dcebaff85dfb326d7c31b Mon Sep 17 00:00:00 2001 From: Strahinja Kustudic Date: Wed, 22 May 2024 22:16:00 +0200 Subject: [PATCH] Fix the homebrew module failing because of warnings Instead of checking if there is an error message, which can also be a warning, we now check the return code. This commit fixes #8229 #7044 --- plugins/modules/homebrew.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/homebrew.py b/plugins/modules/homebrew.py index 388682d9241..187c679b29a 100644 --- a/plugins/modules/homebrew.py +++ b/plugins/modules/homebrew.py @@ -415,7 +415,7 @@ def _current_package_is_installed(self): if self.force_formula: cmd.append("--formula") rc, out, err = self.module.run_command(cmd) - if err: + if rc != 0: self.failed = True self.message = err.strip() raise HomebrewException(self.message)