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)