From 205639f4997859bfa73d649b88cfc49db0fab758 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 24 Jun 2022 15:15:04 +0800 Subject: [PATCH] =?UTF-8?q?paramiko=20=E7=A7=BB=E5=8A=A8=E5=88=B0...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 1 + route/__init__.py | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 4b1870f88..3d160b3d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,6 +19,7 @@ python-engineio==3.13.2 python-socketio==4.2.0 Flask-SocketIO==3.0.2 zmq==0.0.0 +paramiko>=2.8.0 pymongo pillow Jinja2>=2.11.2 diff --git a/route/__init__.py b/route/__init__.py index cb1d85351..924d8118b 100755 --- a/route/__init__.py +++ b/route/__init__.py @@ -448,16 +448,14 @@ def connected_msg(msg): pass # print 'connected_msg:' + str(e) - try: import paramiko ssh = paramiko.SSHClient() - # 尝试启动时连接 + # 启动尝试时连接 connect_ssh() -except: - print("本地终端可能无法使用") - mw.execShell('pip3 install paramiko &') +except Exception as e: + print("本地终端无法使用") ##################### ssh end ###########################