From 83c1f8e4d313ac7217d3fa685f6793a57f68a22e Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Fri, 19 Jul 2024 10:37:42 +0800 Subject: [PATCH] perf: The gateway password contains ! Password parsing failed --- apps/libs/ansible/modules_utils/custom_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/libs/ansible/modules_utils/custom_common.py b/apps/libs/ansible/modules_utils/custom_common.py index 235a65588..f27446e9e 100644 --- a/apps/libs/ansible/modules_utils/custom_common.py +++ b/apps/libs/ansible/modules_utils/custom_common.py @@ -121,7 +121,7 @@ class SSHClient: def local_gateway_prepare(self): gateway_args = self.module.params['gateway_args'] or '' - pattern = r"(?:sshpass -p ([\w@]+))?\s*ssh -o Port=(\d+)\s+-o StrictHostKeyChecking=no\s+([\w@]+)@([" \ + pattern = r"(?:sshpass -p ([^ ]+))?\s*ssh -o Port=(\d+)\s+-o StrictHostKeyChecking=no\s+([\w@]+)@([" \ r"\d.]+)\s+-W %h:%p -q(?: -i (.+))?'" match = re.search(pattern, gateway_args)