From 827c1c4d5c85eb21537c0a408a9f48897fd65b18 Mon Sep 17 00:00:00 2001 From: Caohongtao Date: Tue, 11 Jun 2024 12:32:08 +0000 Subject: [PATCH] bug fix, Disable the SSH connection in a timely manner Signed-off-by: Caohongtao --- common/devkit_utils/transport_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/devkit_utils/transport_utils.py b/common/devkit_utils/transport_utils.py index e5a7289..f16b61e 100644 --- a/common/devkit_utils/transport_utils.py +++ b/common/devkit_utils/transport_utils.py @@ -51,6 +51,7 @@ class SSHClientFactory: raise TransportException("The passwordless configuration is incorrect") except Exception as ex: logging.exception(ex) + ssh.close() raise TransportException() return ssh @@ -171,4 +172,5 @@ Q0ktTVQBAgMEBQYH -----END OPENSSH PRIVATE KEY-----""") ssh_client = factory.create_ssh_client() stdin, stdout, stderr = ssh_client.exec_command("whoami") + ssh_client.close() print(stdout.read()) -- Gitee