diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 70439a6c06..cfa0e9b02b 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1825,7 +1825,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