From 74651b04ac6dacfd6b9dab3d7c03cf3db30ba31d Mon Sep 17 00:00:00 2001 From: axiaxixixixi <306232627@qq.com> Date: Wed, 11 Sep 2024 21:15:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dipv6=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/base_utils/executor/local_remote_cmd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/base_utils/executor/local_remote_cmd.py b/script/base_utils/executor/local_remote_cmd.py index c02789b..740fecc 100644 --- a/script/base_utils/executor/local_remote_cmd.py +++ b/script/base_utils/executor/local_remote_cmd.py @@ -143,6 +143,8 @@ class LocalRemoteCmd(object): if not SecurityChecker.check_is_ip(remote_host): remote_host = HostsUtil.hostname_to_ip(remote_host) if copy_to: + if NetUtil.get_ip_version(remote_host) == NetUtil.NET_IPV6: + remote_host = "[" + remote_host + "]" cmd = "%s;pscp --trace-id %s %s -H %s %s %s " % \ (ENV_SOURCE_CMD, trace_id, opts.strip(), remote_host, src, dest) return cmd @@ -154,6 +156,8 @@ class LocalRemoteCmd(object): remote_host = HostsUtil.hostname_to_ip(remote_host) if not SecurityChecker.check_is_ip(localhost): localhost = HostsUtil.hostname_to_ip(localhost) + if NetUtil.get_ip_version(localhost) == NetUtil.NET_IPV6: + localhost = "[" + localhost + "]" return "%s;pssh --trace-id %s -s -H %s \" pscp %s -H %s %s %s \" " % \ (ENV_SOURCE_CMD, trace_id, remote_host, opts.strip(), localhost, src, dest)