diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index c0a0547d45a..b90eccc4e11 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 ] + args = [ os.path.expandvars(os.path.expanduser(x)) for x in args if x ] rc = 0 msg = None