Commit 68325dbf by Brian Coca

fixed remote tmp creation when becoem user is not root and '~/' instead of $HOME is the default

parent 102de96e
...@@ -62,7 +62,7 @@ class ShellModule(object): ...@@ -62,7 +62,7 @@ class ShellModule(object):
if not basefile: if not basefile:
basefile = 'ansible-tmp-%s-%s' % (time.time(), random.randint(0, 2**48)) basefile = 'ansible-tmp-%s-%s' % (time.time(), random.randint(0, 2**48))
basetmp = self.join_path(C.DEFAULT_REMOTE_TMP, basefile) basetmp = self.join_path(C.DEFAULT_REMOTE_TMP, basefile)
if system and basetmp.startswith('$HOME'): if system and basetmp.startswith('$HOME') or basetmp.startswith('~/'):
basetmp = self.join_path('/tmp', basefile) basetmp = self.join_path('/tmp', basefile)
cmd = 'mkdir -p %s' % basetmp cmd = 'mkdir -p %s' % basetmp
if mode: if mode:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment