Spaces:
Running
on
Zero
Running
on
Zero
Update ssh
Browse files- model/matchmaker.py +2 -0
- serve/update_skill.py +2 -0
- serve/upload.py +2 -0
model/matchmaker.py
CHANGED
@@ -24,6 +24,8 @@ def create_ssh_matchmaker_client(server, port, user, password):
|
|
24 |
sftp_matchmaker_client = ssh_matchmaker_client.open_sftp()
|
25 |
def is_connected():
|
26 |
global ssh_matchmaker_client, sftp_matchmaker_client
|
|
|
|
|
27 |
# 检查SSH连接是否正常
|
28 |
if not ssh_matchmaker_client.get_transport().is_active():
|
29 |
return False
|
|
|
24 |
sftp_matchmaker_client = ssh_matchmaker_client.open_sftp()
|
25 |
def is_connected():
|
26 |
global ssh_matchmaker_client, sftp_matchmaker_client
|
27 |
+
if ssh_matchmaker_client is None or sftp_matchmaker_client is None:
|
28 |
+
return False
|
29 |
# 检查SSH连接是否正常
|
30 |
if not ssh_matchmaker_client.get_transport().is_active():
|
31 |
return False
|
serve/update_skill.py
CHANGED
@@ -25,6 +25,8 @@ def create_ssh_skill_client(server, port, user, password):
|
|
25 |
sftp_skill_client = ssh_skill_client.open_sftp()
|
26 |
def is_connected():
|
27 |
global ssh_skill_client, sftp_skill_client
|
|
|
|
|
28 |
# 检查SSH连接是否正常
|
29 |
if not ssh_skill_client.get_transport().is_active():
|
30 |
return False
|
|
|
25 |
sftp_skill_client = ssh_skill_client.open_sftp()
|
26 |
def is_connected():
|
27 |
global ssh_skill_client, sftp_skill_client
|
28 |
+
if ssh_skill_client is None or sftp_skill_client is None:
|
29 |
+
return False
|
30 |
# 检查SSH连接是否正常
|
31 |
if not ssh_skill_client.get_transport().is_active():
|
32 |
return False
|
serve/upload.py
CHANGED
@@ -23,6 +23,8 @@ def create_ssh_client(server, port, user, password):
|
|
23 |
sftp_client = ssh_client.open_sftp()
|
24 |
def is_connected():
|
25 |
global ssh_client, sftp_client
|
|
|
|
|
26 |
# 检查SSH连接是否正常
|
27 |
if not ssh_client.get_transport().is_active():
|
28 |
return False
|
|
|
23 |
sftp_client = ssh_client.open_sftp()
|
24 |
def is_connected():
|
25 |
global ssh_client, sftp_client
|
26 |
+
if ssh_client is None or sftp_client is None:
|
27 |
+
return False
|
28 |
# 检查SSH连接是否正常
|
29 |
if not ssh_client.get_transport().is_active():
|
30 |
return False
|