From b58eaca7e8730dee48091327590426c6e8cd6ed3 Mon Sep 17 00:00:00 2001 From: Matthew Gamble Date: Wed, 23 Mar 2016 18:39:26 +1100 Subject: [PATCH] Remove dead code from pacman module The manual check to see if get_bin_path() returned anything is redundant, because we pass True to the required parameter of get_bin_path(). This automatically causes the task to fail if the pacman binary isn't available. Therefore, the code within the if statement being removed is never called. --- lib/ansible/modules/extras/packaging/os/pacman.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/ansible/modules/extras/packaging/os/pacman.py b/lib/ansible/modules/extras/packaging/os/pacman.py index 419def43a7c..a81f6801ffc 100644 --- a/lib/ansible/modules/extras/packaging/os/pacman.py +++ b/lib/ansible/modules/extras/packaging/os/pacman.py @@ -301,9 +301,6 @@ def main(): pacman_path = module.get_bin_path('pacman', True) - if not os.path.exists(pacman_path): - module.fail_json(msg="cannot find pacman, in path %s" % (pacman_path)) - p = module.params # normalize the state parameter