From 374d491ba5f9c4b52fc15544f563abcb490fc81a Mon Sep 17 00:00:00 2001 From: THEBAULT Julien Date: Fri, 10 Mar 2017 16:19:00 +0100 Subject: [PATCH] Check if file is not a directory with get_bin_path function (#13985) --- lib/ansible/module_utils/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 6cebdd5912..f3230e1375 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1892,7 +1892,7 @@ class AnsibleModule(object): if not d: continue path = os.path.join(d, arg) - if os.path.exists(path) and is_executable(path): + if os.path.exists(path) and not os.path.isdir(path) and is_executable(path): bin_path = path break if required and bin_path is None: