From c416c2635286814cce33f55ef734eb8e9eee2335 Mon Sep 17 00:00:00 2001 From: gqp <446105468@qq.com> Date: Thu, 17 Oct 2024 11:08:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20windows=E6=9C=BA=E5=99=A8=E6=A3=80?= =?UTF-8?q?=E6=9F=A5sshd=E6=9C=8D=E5=8A=A1=E6=97=B6=E6=8A=9B=E5=87=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=20(closed=20#2454)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/backend/components/collections/agent_new/install.py | 2 +- script_tools/setup_pagent.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/backend/components/collections/agent_new/install.py b/apps/backend/components/collections/agent_new/install.py index 8a8ddb4af..c9314e30b 100644 --- a/apps/backend/components/collections/agent_new/install.py +++ b/apps/backend/components/collections/agent_new/install.py @@ -692,7 +692,7 @@ async def execute_shell_solution_async( async with conns.AsyncsshConn(**install_sub_inst_obj.conns_init_params) as conn: if install_sub_inst_obj.host.os_type == constants.OsType.WINDOWS: - sshd_info = await conn.run(POWERSHELL_SERVICE_CHECK_SSHD, check=True, timeout=SSH_RUN_TIMEOUT) + sshd_info = await conn.run(POWERSHELL_SERVICE_CHECK_SSHD, check=False, timeout=SSH_RUN_TIMEOUT) if sshd_info.exit_status == 0 and "cygwin" not in sshd_info.stdout.lower(): self.build_shell_to_batch_command_converter(execution_solution.steps, command_converter) diff --git a/script_tools/setup_pagent.py b/script_tools/setup_pagent.py index 2876e3335..c4031683e 100644 --- a/script_tools/setup_pagent.py +++ b/script_tools/setup_pagent.py @@ -374,7 +374,7 @@ def execute_shell_solution( ) as conn: command_converter = {} if os_type == "windows": - run_output: RunOutput = conn.run(POWERSHELL_SERVICE_CHECK_SSHD, check=True, timeout=30) + run_output: RunOutput = conn.run(POWERSHELL_SERVICE_CHECK_SSHD, check=False, timeout=30) if run_output.exit_status == 0 and "cygwin" not in run_output.stdout.lower(): for step in execution_solution["steps"]: if step["type"] != "commands":