Fixes/notes related to slashes in remote paths.

This commit is contained in:
Chris Church
2014-06-18 10:01:11 -05:00
committed by Matt Martz
parent 4991c77479
commit 21ba529fbe
6 changed files with 16 additions and 9 deletions

View File

@@ -58,6 +58,10 @@ class ShellModule(object):
def join_path(self, *args):
return os.path.join(*args).replace('/', '\\')
def path_has_trailing_slash(self, path):
# Allow Windows paths to be specified using either slash.
return path.endswith('/') or path.endswith('\\')
def chmod(self, mode, path):
return ''

View File

@@ -33,6 +33,9 @@ class ShellModule(object):
def join_path(self, *args):
return os.path.join(*args)
def path_has_trailing_slash(self, path):
return path.endswith('/')
def chmod(self, mode, path):
path = pipes.quote(path)
return 'chmod %s %s' % (mode, path)