perf: 兼容自定义平台的华为交换机执行命令

This commit is contained in:
wangruidong
2024-04-19 17:59:12 +08:00
committed by Bryan
parent 94286caec4
commit 1ecf8534f6

View File

@@ -5,6 +5,7 @@ import re
from collections import defaultdict
from django.utils.translation import gettext as _
from assets.const.category import Category
__all__ = ['JMSInventory']
@@ -124,7 +125,7 @@ class JMSInventory:
else:
host.update(self.make_account_ansible_vars(account, path_dir))
if platform.name == 'Huawei':
if "huawei" in platform.name.lower() and platform.category == Category.DEVICE.value:
host['ansible_connection'] = 'network_cli'
host['ansible_network_os'] = 'asa'