diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 06f4727e8a..e57b1943aa 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1546,6 +1546,8 @@ class AnsibleModule(object): if p not in paths and os.path.exists(p): paths.append(p) for d in paths: + if not d: + continue path = os.path.join(d, arg) if os.path.exists(path) and is_executable(path): bin_path = path