Skip to content

Commit

Permalink
feature: 接入点主机配置信息缺省规则 (closed #1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
CohleRustW authored and ZhuoZhuoCrayon committed Dec 22, 2022
1 parent c2c4641 commit 734650e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/backend/components/collections/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,12 @@ def get_ap_config(ap_id_obj_map: Dict[int, models.AccessPoint], host: models.Hos
"""获取接入点配置"""
ap = ap_id_obj_map.get(host.ap_id)
os_type = host.os_type.lower()
ap_config = ap.agent_config.get(os_type)
if os_type != constants.OsType.WINDOWS.lower():
ap_config: Optional[Dict[str, Any]] = ap.agent_config.get(os_type) or ap.agent_config.get(
constants.OsType.LINUX.lower()
)
else:
ap_config: Optional[Dict[str, Any]] = ap.agent_config.get(os_type)
if not ap_config:
raise exceptions.ApNotSupportOsError(ap_id=ap.id, os_type=os_type)
return ap_config
Expand Down
3 changes: 3 additions & 0 deletions dev_log/2.2.32/xcwang_202211281220.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
feature:
- "接入点主机配置信息缺省规则 (closed #1283)"

0 comments on commit 734650e

Please sign in to comment.