mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
moved 'path exists' function to shell
now it will work with powershell/winrm
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user