diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index b90eccc4e11..b3eeb633020 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1772,7 +1772,7 @@ class AnsibleModule(object): # expand things like $HOME and ~ if not shell: - args = [ os.path.expandvars(os.path.expanduser(x)) for x in args if x ] + args = [ os.path.expandvars(os.path.expanduser(x)) for x in args if x is not None ] rc = 0 msg = None