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

pull/4420/head
Brian Coca 2015-06-21 01:43:35 -04:00
parent 102de96ebf
commit 68325dbfe2
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ class ShellModule(object):
if not basefile:
basefile = 'ansible-tmp-%s-%s' % (time.time(), random.randint(0, 2**48))
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)
cmd = 'mkdir -p %s' % basetmp
if mode: