Skip to content

Commit

Permalink
fix: 修复已禁用插件仍能通过监控平台的相关订阅步骤触发下发动作问题(closed #2313)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalice-1831 authored and wyyalt committed Dec 27, 2024
1 parent f7c3d8d commit 81b1d3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/backend/subscription/steps/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def __init__(self, subscription_step: models.SubscriptionStep):

self.plugin_name: str = self.policy_step_adapter.plugin_name
self.plugin_desc: models.GsePluginDesc = self.policy_step_adapter.plugin_desc
if not self.plugin_desc.is_ready:
raise errors.PluginValidationError(msg="插件 [{name}] 已被禁用".format(name=self.plugin_name))
self.os_key_pkg_map: Dict[str, models.Packages] = self.policy_step_adapter.os_key_pkg_map
self.config_tmpl_gby_os_key: Dict[
str, List[models.PluginConfigTemplate]
Expand Down Expand Up @@ -103,7 +105,7 @@ def get_matching_package(self, os_type: str, cpu_arch: str) -> models.Packages:
# 此处是为了延迟报错到订阅
if self.os_key_pkg_map:
return list(self.os_key_pkg_map.values())[0]
raise errors.PluginValidationError(msg="插件 [{name}] 没有可供选择的插件包")
raise errors.PluginValidationError(msg="插件 [{name}] 没有可供选择的插件包".format(name=self.plugin_name))

def get_matching_pkg_real_version(self, os_type: str, cpu_arch: str) -> str:
package: models.Packages = self.get_matching_package(os_type, cpu_arch)
Expand Down

0 comments on commit 81b1d3c

Please sign in to comment.