Expand environment variables and tildes passed to commands generically across the board.

This commit is contained in:
Michael DeHaan 2014-03-12 10:10:45 -04:00
parent 0e38f5dfdc
commit 0b0ca95731

View file

@ -1018,6 +1018,9 @@ class AnsibleModule(object):
msg = "Argument 'args' to run_command must be list or string"
self.fail_json(rc=257, cmd=args, msg=msg)
# expand things like $HOME and ~
args = [ os.path.expandvars(os.path.expanduser(x)) for x in args ]
rc = 0
msg = None
st_in = None