Commit 1e4623ba authored by 金凯强's avatar 金凯强 🎨

修复上传文件和下载文件bug

parent 6ec57eef
...@@ -57,15 +57,14 @@ if __name__ == '__main__': ...@@ -57,15 +57,14 @@ if __name__ == '__main__':
# res = requests.post('http://localhost:5000/info/app_upgrade/', json=json_data) # res = requests.post('http://localhost:5000/info/app_upgrade/', json=json_data)
# print(res.json()) # print(res.json())
# # 获取app升级日志列表
# 获取app升级日志列表 # res = requests.get('http://localhost:5000/info/upgrade_log/')
res = requests.get('http://localhost:5000/info/upgrade_log/') # print(json.dumps(res.json(), indent=4))
print(json.dumps(res.json(), indent=4)) #
#
# # 获取app单次升级日志明细
# 获取app单次升级日志明细 # res = requests.get('http://localhost:5000/info/upgrade_log_dtl/1237995081698545664/')
res = requests.get('http://localhost:5000/info/upgrade_log_dtl/1237995081698545664/') # print(json.dumps(res.json(), indent=4))
print(json.dumps(res.json(), indent=4))
# 安装runner # 安装runner
# res = requests.get('http://localhost:5000/install/runner/') # res = requests.get('http://localhost:5000/install/runner/')
...@@ -74,3 +73,7 @@ if __name__ == '__main__': ...@@ -74,3 +73,7 @@ if __name__ == '__main__':
# # 回滚升级 # # 回滚升级
# res = requests.get('http://localhost:5000/upgrade/rollback/1238022723059486720/') # res = requests.get('http://localhost:5000/upgrade/rollback/1238022723059486720/')
# print(json.dumps(res.json(), indent=4)) # print(json.dumps(res.json(), indent=4))
# 远程升级
res = requests.get('http://localhost:5000/upgrade/remote/')
print(json.dumps(res.json(), indent=4))
...@@ -47,7 +47,7 @@ class SSHConnect(): ...@@ -47,7 +47,7 @@ class SSHConnect():
:param local_path: 本地文件地址 :param local_path: 本地文件地址
:param target_path: 目标文件路径 :param target_path: 目标文件路径
""" """
sftp = paramiko.SFTPClient.from_transport(self.ssh) sftp = paramiko.SFTPClient.from_transport(self.ssh.get_transport())
sftp.put(local_path, target_path) sftp.put(local_path, target_path)
def download(self, remote_path, local_path): def download(self, remote_path, local_path):
...@@ -56,5 +56,5 @@ class SSHConnect(): ...@@ -56,5 +56,5 @@ class SSHConnect():
:param remote_path: 服务器文件路径 :param remote_path: 服务器文件路径
:param local_path: 本地目标路径 :param local_path: 本地目标路径
""" """
sftp = paramiko.SFTPClient.from_transport(self.ssh) sftp = paramiko.SFTPClient.from_transport(self.ssh.get_transport())
sftp.get(remote_path, local_path) sftp.get(remote_path, local_path)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment