Skip to content

Commit d861a36

Browse files
chalice-1831wyyalt
authored andcommitted
fix: 修复插件订阅执行时无法获取aix系统对应接入点的agent_config(closed #2709)
1 parent 421265a commit d861a36

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

apps/backend/components/collections/plugin.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def get_agent_config_by_process_status(
195195
ap = ap_id_obj_map.get(host.ap_id)
196196
if not ap:
197197
raise exceptions.ApIDNotExistsError()
198-
agent_config = ap.agent_config.get(host.os_type.lower()) or ap.agent_config["linux"]
198+
agent_config = ap.get_agent_config(host.os_type)
199199
return agent_config
200200

201201
def get_package_by_process_status(
@@ -396,12 +396,7 @@ def get_ap_config(ap_id_obj_map: Dict[int, models.AccessPoint], host: models.Hos
396396
"""获取接入点配置"""
397397
ap = ap_id_obj_map.get(host.ap_id)
398398
os_type = host.os_type.lower()
399-
if os_type != constants.OsType.WINDOWS.lower():
400-
ap_config: Optional[Dict[str, Any]] = ap.agent_config.get(os_type) or ap.agent_config.get(
401-
constants.OsType.LINUX.lower()
402-
)
403-
else:
404-
ap_config: Optional[Dict[str, Any]] = ap.agent_config.get(os_type)
399+
ap_config: Optional[Dict[str, Any]] = ap.get_agent_config(os_type)
405400
if not ap_config:
406401
raise exceptions.ApNotSupportOsError(ap_id=ap.id, os_type=os_type)
407402
return ap_config

apps/backend/subscription/steps/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def check_config_change(
265265
ap = ap_id_obj_map.get(target_host.ap_id)
266266
if not ap:
267267
raise ApIDNotExistsError()
268-
agent_config = ap.agent_config[target_host.os_type.lower()]
268+
agent_config = ap.get_agent_config(target_host.os_type)
269269
context = tools.get_all_subscription_steps_context(
270270
subscription_step,
271271
instance_info,

0 commit comments

Comments
 (0)