mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-01 15:37:19 +00:00
perf: 优化发布机终端名称
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user