From 12209c1bdc093d9b008633281a330591438d5f98 Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 8 Sep 2021 11:16:35 +0200 Subject: [PATCH] core (main): check plugin modes and skip pluggin/log an error if value is invalid --- sat/core/sat_main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sat/core/sat_main.py b/sat/core/sat_main.py index 055b03bd..6066528f 100644 --- a/sat/core/sat_main.py +++ b/sat/core/sat_main.py @@ -330,6 +330,12 @@ class SAT(service.Service): plugin_modes = plugin_info["modes"] = set( plugin_info.setdefault("modes", C.PLUG_MODE_DEFAULT) ) + if not plugin_modes.intersection(C.PLUG_MODE_BOTH): + log.error( + f"Can't import plugin at {plugin_path}, invalid {C.PI_MODES!r} " + f"value: {plugin_modes!r}" + ) + continue # if the plugin is an entry point, it must work in component mode if plugin_info["type"] == C.PLUG_TYPE_ENTRY_POINT: