def load_plugins(force): global loaded_with_language, search_plugins _register_custom_snapins() if loaded_with_language == cmk.gui.i18n.get_current_language( ) and not force: return # Load all snapins search_plugins = [] utils.load_web_plugins("sidebar", globals()) transform_old_dict_based_snapins() transform_old_quicksearch_match_plugins() # This must be set after plugin loading to make broken plugins raise # exceptions all the time and not only the first time (when the plugins # are loaded). loaded_with_language = cmk.gui.i18n.get_current_language()
def load_plugins(force: bool) -> None: global loaded_with_language if loaded_with_language == cmk.gui.i18n.get_current_language( ) and not force: return # Initialize watolib things which are needed before loading the WATO plugins. # This also loads the watolib plugins. watolib.load_watolib_plugins() utils.load_web_plugins("wato", globals()) if modes: raise MKGeneralException( _("Deprecated WATO modes found: %r. " "They need to be refactored to new API.") % list(modes.keys())) # This must be set after plugin loading to make broken plugins raise # exceptions all the time and not only the first time (when the plugins # are loaded). loaded_with_language = cmk.gui.i18n.get_current_language()
def _get_default_config_from_legacy_plugins() -> Dict[str, Any]: """Plugins from local/share/check_mk/web/plugins/config are loaded here""" default_config: Dict[str, Any] = {} utils.load_web_plugins("config", default_config) return default_config
def load_plugins(force: bool) -> None: utils.load_web_plugins("config", globals()) # Make sure, builtin roles are present, even if not modified and saved with WATO. for br in builtin_role_ids: roles.setdefault(br, {})
# | Perf-O-Meters created by new metrics system | # '----------------------------------------------------------------------' # Create HTML representation of Perf-O-Meter def render_metricometer(stack): if len(stack) not in (1, 2): raise MKGeneralException( _("Invalid Perf-O-Meter definition %r: only one or two entries are allowed" ) % stack) h = HTML().join(map(render_perfometer, stack)) if len(stack) == 2: h = html.render_div(h, class_="stacked") return h # Load the legacy plugins utils.load_web_plugins("perfometer", globals()) #. # .--Plugins-------------------------------------------------------------. # | ____ _ _ | # | | _ \| |_ _ __ _(_)_ __ ___ | # | | |_) | | | | |/ _` | | '_ \/ __| | # | | __/| | |_| | (_| | | | | \__ \ | # | |_| |_|\__,_|\__, |_|_| |_|___/ | # | |___/ | # '----------------------------------------------------------------------' load_plugins(__file__, __package__)
def load_plugins() -> None: """Plugin initialization hook (Called by cmk.gui.main_modules.load_plugins())""" utils.load_web_plugins("webapi", globals())
def load_plugins() -> None: """Plugin initialization hook (Called by cmk.gui.main_modules.load_plugins())""" _register_pre_21_plugin_api() utils.load_web_plugins("sidebar", globals()) transform_old_dict_based_snapins()
def load_plugins() -> None: """Plugin initialization hook (Called by cmk.gui.main_modules.load_plugins())""" _register_pre_21_plugin_api() utils.load_web_plugins("cron", globals())