fix issues

pull/410/head
vapao 2021-09-08 00:10:19 +08:00
parent de4bffbb50
commit f414e9504f
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ def ping_check(addr):
def host_executor(host, command): def host_executor(host, command):
try: try:
with host.get_ssh() as ssh: 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: if exit_code == 0:
return True, out or '检测状态正常' return True, out or '检测状态正常'
else: else:

View File

@ -29,7 +29,7 @@ def host_executor(host, command):
code, out, now = 1, None, time.time() code, out, now = 1, None, time.time()
try: try:
with host.get_ssh() as ssh: with host.get_ssh() as ssh:
code, out = ssh.exec_command(command) code, out = ssh.exec_command_raw(command)
except AuthenticationException: except AuthenticationException:
out = 'ssh authentication fail' out = 'ssh authentication fail'
except socket.error as e: except socket.error as e: