[checkmk-commits] [tribe29/checkmk] baf60c: 7766 FIX Raw Edition: Fix missing default ruleset ...

Lars noreply at github.com
Tue Jun 11 14:10:42 CEST 2019

  Branch: refs/heads/1.6.0
  Home:   https://github.com/tribe29/checkmk
  Commit: baf60c1993f389e0b56d80101122ac59344894c1
  Author: Lars Michelsen <lm at tribe29.com>
  Date:   2019-06-11 (Tue, 11 Jun 2019)

  Changed paths:
    A .werks/7766

  Log Message:
  7766 FIX Raw Edition: Fix missing default ruleset and automation user

When creating a new site with Checkmk Raw Edition 1.6.0b1 the sample
configuration could not be created correctly. It was missing the empty
sample Event Console rule pack and the builtin "automation" user.

In the moment this happens an error like this is visible in var/log/web.log:

UnboundLocalError: local variable 'cmk' referenced before assignment

Change-Id: I5c3c48f6f0404c0e6ea4564090caa20834a281a5

  Commit: 50e75a21f2ddc8d005c802a6768c6bebfbc3a943
  Author: Lars Michelsen <lm at tribe29.com>
  Date:   2019-06-11 (Tue, 11 Jun 2019)

  Changed paths:
    M cmk/gui/plugins/wato/__init__.py
    M cmk/gui/plugins/wato/utils/__init__.py
    M cmk/gui/plugins/watolib/utils.py
    M cmk/gui/wato/mkeventd.py
    M cmk/gui/watolib/__init__.py
    A tests/unit/cmk/gui/plugins/wato/utils/test_sample_config.py

  Log Message:
  Modularied WATO sample config creation

The _create_sample_config() in watolib.__init__ imported several modules
in a way that it was not allowed to. Because these imports were
resulting in circular dependencies the imports were done locally in the
function. This could lead to errors e.g. when creating the sample config
for Raw Edition installations.

The registration of sample configurations has now been moved to a central
class registry object in cmk.gui.plugins.wato.utils which can be
imported from all necessary places.

The watolib._create_sample_config function is then calling all registered
sample config generators in a defined order.

One difference is that the sample configuration executes all generators
in the desired order, even when a single generator fails. In such a
situation an error is written to the web.log.

Change-Id: I1cb412f4373ebfd3027dbf0b538dbab6dc85bb96

Compare: https://github.com/tribe29/checkmk/compare/8bebcb7355e5...50e75a21f2dd

More information about the checkmk-commits mailing list