Bug fixing in file transfer. If ahenk's folder in remote machine has not been created yet , create new folder for ahenk. There were no path for mkdir method.

This commit is contained in:
cemrealpsoy 2016-07-13 15:56:42 +03:00
parent b03c1f3b8c
commit a94d5ed598

View file

@ -40,7 +40,8 @@ class Ssh(object):
try: try:
sftp.chdir(self.target_path) # Test if remote_path exists sftp.chdir(self.target_path) # Test if remote_path exists
except IOError: except IOError:
sftp.mkdir() # Create remote_path print(self.target_path)
sftp.mkdir(self.target_path) # Create remote_path
sftp.chdir(self.target_path) sftp.chdir(self.target_path)
sftp.put(local_path, self.target_path + md5) sftp.put(local_path, self.target_path + md5)