From f32482ed694b464882fad68768431d2fed807b09 Mon Sep 17 00:00:00 2001 From: Maximilian Hill Date: Mon, 13 May 2024 13:56:57 +0200 Subject: [PATCH] Workaround for version dependant functionality Fixes Error: cannot import name 'is_enterprise_edition' from 'cmk.utils.version' --- mkp/web/plugins/wato/log4j_scanner.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mkp/web/plugins/wato/log4j_scanner.py b/mkp/web/plugins/wato/log4j_scanner.py index c54ee7e..6b35595 100644 --- a/mkp/web/plugins/wato/log4j_scanner.py +++ b/mkp/web/plugins/wato/log4j_scanner.py @@ -15,13 +15,15 @@ Alternative, FixedValue, ) -from cmk.utils.version import ( - is_enterprise_edition, - is_managed_edition, -) -if is_managed_edition() or is_enterprise_edition(): +try: + from cmk.utils.version import ( + is_enterprise_edition, + is_managed_edition, + ) + + from cmk.gui.cee.plugins.wato.agent_bakery.rulespecs.utils import ( RulespecGroupMonitoringAgentsAgentPlugins ) @@ -59,3 +61,6 @@ def _valuespec_agent_config_log4j_scanner(): name="agent_config:log4j_scanner", valuespec=_valuespec_agent_config_log4j_scanner, )) + +except: + pass