From f414e9504f6b18d0ff7d9b3acc86051a6c421ff1 Mon Sep 17 00:00:00 2001 From: vapao Date: Wed, 8 Sep 2021 00:10:19 +0800 Subject: [PATCH] fix issues --- spug_api/apps/monitor/executors.py | 2 +- spug_api/apps/schedule/executors.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spug_api/apps/monitor/executors.py b/spug_api/apps/monitor/executors.py index a654613..f759267 100644 --- a/spug_api/apps/monitor/executors.py +++ b/spug_api/apps/monitor/executors.py @@ -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: diff --git a/spug_api/apps/schedule/executors.py b/spug_api/apps/schedule/executors.py index 533f0b5..1575a1a 100644 --- a/spug_api/apps/schedule/executors.py +++ b/spug_api/apps/schedule/executors.py @@ -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: