mirror of https://github.com/openspug/spug
fix issues
parent
de4bffbb50
commit
f414e9504f
|
@ -57,7 +57,7 @@ def ping_check(addr):
|
|||
def host_executor(host, command):
|
||||
try:
|
||||
with host.get_ssh() as ssh:
|
||||
exit_code, out = ssh.exec_command(command)
|
||||
exit_code, out = ssh.exec_command_raw(command)
|
||||
if exit_code == 0:
|
||||
return True, out or '检测状态正常'
|
||||
else:
|
||||
|
|
|
@ -29,7 +29,7 @@ def host_executor(host, command):
|
|||
code, out, now = 1, None, time.time()
|
||||
try:
|
||||
with host.get_ssh() as ssh:
|
||||
code, out = ssh.exec_command(command)
|
||||
code, out = ssh.exec_command_raw(command)
|
||||
except AuthenticationException:
|
||||
out = 'ssh authentication fail'
|
||||
except socket.error as e:
|
||||
|
|
Loading…
Reference in New Issue