From cbe384161ac4f51518b627432ca2a7fcef62e5d4 Mon Sep 17 00:00:00 2001 From: jiangweidong Date: Mon, 3 Apr 2023 10:17:00 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/ansible/inventory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/ops/ansible/inventory.py b/apps/ops/ansible/inventory.py index b247d0547..d98d105e5 100644 --- a/apps/ops/ansible/inventory.py +++ b/apps/ops/ansible/inventory.py @@ -107,7 +107,7 @@ class JMSInventory: host.update(self.make_proxy_command(gateway)) @staticmethod - def get_ansible_protocol(ansible_config, protocols): + def get_primary_protocol(ansible_config, protocols): invalid_protocol = type('protocol', (), {'name': 'null', 'port': 0}) ansible_connection = ansible_config.get('ansible_connection') # 数值越小,优先级越高,若用户在 ansible_config 中配置了,则提高用户配置方式的优先级 @@ -136,7 +136,7 @@ class JMSInventory: except (AttributeError, TypeError): ansible_config = {} - protocol = self.get_ansible_protocol(ansible_config, protocols) + protocol = self.get_primary_protocol(ansible_config, protocols) host = { 'name': '{}'.format(asset.name.replace(' ', '_')),