From 5e54792d946d8fcd9037553d4affda040bf8206f Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 8 Nov 2023 13:47:24 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=9C=BA=E7=BB=88=E7=AB=AF=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/automations/deploy_applet_host/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/terminal/automations/deploy_applet_host/__init__.py b/apps/terminal/automations/deploy_applet_host/__init__.py index 4fe4a23c1..c8e4d9e27 100644 --- a/apps/terminal/automations/deploy_applet_host/__init__.py +++ b/apps/terminal/automations/deploy_applet_host/__init__.py @@ -60,7 +60,8 @@ class DeployAppletHostManager: download_host = download_host.rstrip("/") def handler(plays): - applet_host_name = re.sub(r'[^a-zA-Z0-9]', '_', self.deployment.host.name) + # 替换所有的特殊字符为下划线 _ , 防止因主机名称造成任务执行失败 + applet_host_name = re.sub(r'\W', '_', self.deployment.host.name, flags=re.UNICODE) hostname = '{}-{}'.format(applet_host_name, random_string(7)) for play in plays: play["vars"].update(options)