moved 'path exists' function to shell

now it will work with powershell/winrm
This commit is contained in:
Brian Coca 2016-03-25 08:13:44 -07:00
commit 28d20dbe53
4 changed files with 29 additions and 8 deletions

View file

@ -94,6 +94,10 @@ class ShellBase(object):
cmd += '-r '
return cmd + "%s %s" % (path, self._SHELL_REDIRECT_ALLNULL)
def exists(self, path):
cmd = ['test', '-e', pipes.quote(path)]
return ' '.join(cmd)
def mkdtemp(self, basefile=None, system=False, mode=None):
if not basefile:
basefile = 'ansible-tmp-%s-%s' % (time.time(), random.randint(0, 2**48))