|
|
|
|
@ -275,9 +275,13 @@ class Connection(ConnectionBase):
|
|
|
|
|
|
|
|
|
|
Can revisit using $HOME instead if it's a problem
|
|
|
|
|
'''
|
|
|
|
|
if not remote_path.startswith(os.path.sep):
|
|
|
|
|
remote_path = os.path.join(os.path.sep, remote_path)
|
|
|
|
|
return os.path.normpath(remote_path)
|
|
|
|
|
if getattr(self._shell, "_IS_WINDOWS", False):
|
|
|
|
|
import ntpath
|
|
|
|
|
return ntpath.normpath(remote_path)
|
|
|
|
|
else:
|
|
|
|
|
if not remote_path.startswith(os.path.sep):
|
|
|
|
|
remote_path = os.path.join(os.path.sep, remote_path)
|
|
|
|
|
return os.path.normpath(remote_path)
|
|
|
|
|
|
|
|
|
|
def put_file(self, in_path, out_path):
|
|
|
|
|
""" Transfer a file from local to docker container """
|
|
|
|
|
@ -329,7 +333,11 @@ class Connection(ConnectionBase):
|
|
|
|
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
|
|
p.communicate()
|
|
|
|
|
|
|
|
|
|
actual_out_path = os.path.join(out_dir, os.path.basename(in_path))
|
|
|
|
|
if getattr(self._shell, "_IS_WINDOWS", False):
|
|
|
|
|
import ntpath
|
|
|
|
|
actual_out_path = ntpath.join(out_dir, ntpath.basename(in_path))
|
|
|
|
|
else:
|
|
|
|
|
actual_out_path = os.path.join(out_dir, os.path.basename(in_path))
|
|
|
|
|
|
|
|
|
|
if p.returncode != 0:
|
|
|
|
|
# Older docker doesn't have native support for fetching files command `cp`
|
|
|
|
|
|