Skip to content
Permalink
Browse files

Move cmk_base to cmk.base

cmk_base was the first larger Python module we built and does not fit
correctly into our current module hierarchy. The correct place is
cmk.base. This commits moves the files over.

Change-Id: I424a9f3a251e47c7e052751fbb9e0c1c6cd5152b
  • Loading branch information
LarsMichelsen committed Jan 7, 2020
1 parent 2e43320 commit 0ad335773ff0f8ada97b510df687cb74a6b5266b
Showing with 818 additions and 819 deletions.
  1. +0 −9 Makefile
  2. +1 −1 agents/windows/it/test_old_agent_start_parameters.py
  3. +10 −10 bin/check_mk
  4. +9 −9 bin/update_rrd_fs_names.py
  5. +3 −2 checks/agent_bi
  6. +3 −2 checks/agent_prometheus
  7. +1 −1 checks/domino_tasks
  8. +1 −1 checks/esx_vsphere_hostsystem
  9. +3 −2 checks/fileinfo
  10. +1 −1 checks/local
  11. +1 −1 checks/logwatch
  12. +1 −1 checks/ps
  13. +1 −1 checks/services
  14. +31 −0 cmk/base/.f12
  15. +3 −3 {cmk_base → cmk/base}/__init__.py
  16. 0 {cmk_base → cmk/base}/agent_simulator.py
  17. +7 −7 {cmk_base → cmk/base}/autochecks.py
  18. +5 −5 {cmk_base → cmk/base}/automations/__init__.py
  19. +34 −34 {cmk_base → cmk/base}/automations/check_mk.py
  20. +1 −1 {cmk_base → cmk/base}/backup.py
  21. 0 {cmk_base → cmk/base}/caching.py
  22. +13 −13 {cmk_base → cmk/base}/check_api.py
  23. +2 −2 {cmk_base → cmk/base}/check_api_utils.py
  24. +8 −8 {cmk_base → cmk/base}/check_table.py
  25. +6 −6 {cmk_base → cmk/base}/check_utils.py
  26. +27 −27 {cmk_base → cmk/base}/checking.py
  27. +3 −3 {cmk_base → cmk/base}/classic_snmp.py
  28. 0 {cmk_base → cmk/base}/cleanup.py
  29. 0 {cmk_base → cmk/base}/compress_history.py
  30. +52 −52 {cmk_base → cmk/base}/config.py
  31. 0 {cmk_base → cmk/base}/console.py
  32. +8 −8 {cmk_base → cmk/base}/core.py
  33. +6 −6 {cmk_base → cmk/base}/core_config.py
  34. +4 −4 {cmk_base → cmk/base}/core_factory.py
  35. +19 −19 {cmk_base → cmk/base}/core_nagios.py
  36. +1 −1 {cmk_base → cmk/base}/cpu_tracking.py
  37. +7 −7 {cmk_base → cmk/base}/crash_reporting.py
  38. +7 −7 {cmk_base → cmk/base}/data_sources/__init__.py
  39. +10 −10 {cmk_base → cmk/base}/data_sources/abstract.py
  40. +7 −7 {cmk_base → cmk/base}/data_sources/host_sections.py
  41. +1 −1 {cmk_base → cmk/base}/data_sources/ipmi.py
  42. +2 −2 {cmk_base → cmk/base}/data_sources/piggyback.py
  43. +3 −3 {cmk_base → cmk/base}/data_sources/programs.py
  44. +7 −7 {cmk_base → cmk/base}/data_sources/snmp.py
  45. +1 −1 {cmk_base → cmk/base}/data_sources/tcp.py
  46. +6 −6 {cmk_base → cmk/base}/decorator.py
  47. 0 {cmk_base → cmk/base}/default_config/__init__.py
  48. +1 −1 {cmk_base → cmk/base}/default_config/base.py
  49. 0 {cmk_base → cmk/base}/default_config/notify.py
  50. 0 {cmk_base → cmk/base}/discovered_labels.py
  51. +32 −32 {cmk_base → cmk/base}/discovery.py
  52. +9 −9 {cmk_base → cmk/base}/dump_host.py
  53. +4 −4 {cmk_base → cmk/base}/events.py
  54. 0 {cmk_base → cmk/base}/exceptions.py
  55. +1 −1 {cmk_base → cmk/base}/export.py
  56. +16 −16 {cmk_base → cmk/base}/inventory.py
  57. +6 −6 {cmk_base → cmk/base}/inventory_plugins.py
  58. +9 −9 {cmk_base → cmk/base}/ip_lookup.py
  59. +2 −2 {cmk_base → cmk/base}/item_state.py
  60. 0 {cmk_base → cmk/base}/localize.py
  61. +1 −1 {cmk_base → cmk/base}/modes/__init__.py
  62. +42 −42 {cmk_base → cmk/base}/modes/check_mk.py
  63. +6 −6 {cmk_base → cmk/base}/nagios_utils.py
  64. +12 −12 {cmk_base → cmk/base}/notify.py
  65. 0 {cmk_base → cmk/base}/packaging.py
  66. +7 −7 {cmk_base → cmk/base}/parent_scan.py
  67. 0 {cmk_base → cmk/base}/prediction.py
  68. +1 −1 {cmk_base → cmk/base}/profiling.py
  69. +14 −14 {cmk_base → cmk/base}/snmp.py
  70. +9 −9 {cmk_base → cmk/base}/snmp_scan.py
  71. 0 {cmk_base → cmk/base}/snmp_utils.py
  72. +1 −1 {cmk_base → cmk/base}/utils.py
  73. +1 −1 cmk/gui/plugins/views/icons/builtin.py
  74. +2 −2 cmk/gui/wato/pages/pattern_editor.py
  75. +1 −1 cmk/gui/wato/pages/rulesets.py
  76. +2 −2 cmk/gui/wato/pages/services.py
  77. +1 −1 cmk/gui/watolib/hosts_and_folders.py
  78. +6 −6 cmk/gui/watolib/rulesets.py
  79. +1 −1 cmk/gui/watolib/tags.py
  80. +3 −3 cmk/update_config.py
  81. +0 −24 cmk_base/.f12
  82. +1 −1 mypy-raw.ini
  83. +5 −7 scripts/find-python-files
  84. +0 −1 scripts/setup.sh
  85. +6 −5 tests-py3/unit/test_find_debug_print.py
  86. +0 −2 tests/.coveragerc_unit
  87. 0 tests/integration/{cmk_base → cmk/base}/snmp/snmp_data/1.3.6.1.6.1.1.0.snmprec
  88. 0 tests/integration/{cmk_base → cmk/base}/snmp/snmp_data/1.3.6.1.6.1.1.0/127.0.0.1.snmprec
  89. 0 tests/integration/{cmk_base → cmk/base}/snmp/snmp_data/cmk-walk/localhost
  90. 0 tests/integration/{cmk_base → cmk/base}/snmp/snmp_data/public.snmprec
  91. +3 −3 tests/integration/{cmk_base → cmk/base}/snmp/test_snmp.py
  92. 0 tests/integration/{cmk_base → cmk/base}/test-files/America/New_York/everyday
  93. 0 tests/integration/{cmk_base → cmk/base}/test-files/CPU_load.info
  94. BIN tests/integration/{cmk_base → cmk/base}/test-files/CPU_load.rrd
  95. 0 tests/integration/{cmk_base → cmk/base}/test-files/Europe/Berlin/26
  96. 0 tests/integration/{cmk_base → cmk/base}/test-files/Europe/Berlin/26.info
  97. 0 tests/integration/{cmk_base → cmk/base}/test-files/Europe/Berlin/everyday
  98. 0 tests/integration/{cmk_base → cmk/base}/test-files/Europe/Berlin/everyday.info
  99. 0 tests/integration/{cmk_base → cmk/base}/test-files/Europe/Berlin/thursday
  100. 0 tests/integration/{cmk_base → cmk/base}/test-files/Europe/Berlin/thursday.info
  101. 0 tests/integration/{cmk_base → cmk/base}/test-files/UTC/sunday
  102. +1 −1 tests/integration/{cmk_base → cmk/base}/test-files/linux-agent-output
  103. +4 −4 tests/integration/{cmk_base → cmk/base}/test_automations.py
  104. +3 −3 tests/integration/{cmk_base → cmk/base}/test_check_variables.py
  105. +53 −50 tests/integration/{cmk_base → cmk/base}/test_data_sources.py
  106. +6 −6 tests/integration/{cmk_base → cmk/base}/test_mgmt_board.py
  107. +4 −4 tests/integration/{cmk_base → cmk/base}/test_modes.py
  108. +4 −4 tests/integration/{cmk_base → cmk/base}/test_services_prediction.py
  109. +2 −2 tests/integration/cmk/gui/test_webapi.py
  110. +1 −1 tests/integration/omd/test_web_access.py
  111. +4 −4 tests/pylint/test_pylint.py
  112. +14 −14 tests/testlib/__init__.py
  113. +2 −2 tests/testlib/base.py
  114. +6 −6 tests/testlib/pylint_checker_cmk_module_layers.py
  115. +2 −2 tests/testlib/pylint_cmk.py
  116. +3 −3 tests/testlib/site.py
  117. +10 −10 tests/unit/checks/checktestlib.py
  118. +4 −4 tests/unit/checks/conftest.py
  119. +2 −2 tests/unit/checks/generictests/checkhandler.py
  120. +1 −1 tests/unit/checks/generictests/datasets/docker_container_status_1.py
  121. +1 −1 tests/unit/checks/generictests/datasets/docker_container_status_2.py
  122. +1 −1 tests/unit/checks/generictests/datasets/docker_node_info_2.py
  123. +1 −1 tests/unit/checks/generictests/datasets/docker_node_info_centos6_regression.py
  124. +1 −1 tests/unit/checks/generictests/datasets/docker_node_info_no_output.py
  125. +1 −1 tests/unit/checks/generictests/datasets/docker_node_info_raw_text.py
  126. +1 −1 tests/unit/checks/generictests/datasets/docker_node_info_regression.py
  127. +1 −1 tests/unit/checks/generictests/datasets/docker_node_info_unknown.py
  128. +1 −1 tests/unit/checks/generictests/datasets/esx_vsphere_vm_regression.py
  129. +1 −1 tests/unit/checks/generictests/datasets/k8s_daemon_pods.py
  130. +1 −1 tests/unit/checks/generictests/datasets/k8s_ingress_infos.py
  131. +1 −1 tests/unit/checks/generictests/datasets/k8s_job_info.py
  132. +1 −1 tests/unit/checks/generictests/datasets/k8s_pod_container_regression.py
  133. +1 −1 tests/unit/checks/generictests/datasets/k8s_stateful_set_replicas.py
  134. +1 −1 tests/unit/checks/test_diskstat_include.py
  135. +1 −1 tests/unit/checks/test_docker_container_diskstat.py
  136. +1 −1 tests/unit/checks/test_f5_bigip_conns.py
  137. +1 −1 tests/unit/checks/test_kernel_check.py
  138. +1 −1 tests/unit/checks/test_lnx_if.py
  139. +1 −1 tests/unit/checks/test_local_expired.py
  140. +1 −1 tests/unit/checks/test_logwatch_privates.py
  141. +1 −1 tests/unit/checks/test_netapp_api_cpu.py
  142. +1 −1 tests/unit/checks/test_oracle_jobs.py
  143. +2 −2 tests/unit/checks/test_ps.py
  144. +1 −1 tests/unit/checks/test_systemd_units.py
  145. +1 −1 tests/unit/checks/test_wmi_check.py
  146. +4 −4 tests/unit/{cmk_base → cmk/base}/conftest.py
  147. +1 −1 tests/unit/{cmk_base → cmk/base}/data_sources/test_ipmi.py
  148. +2 −2 tests/unit/{cmk_base → cmk/base}/snmp/test_classic_snmp.py
  149. +2 −2 tests/unit/{cmk_base → cmk/base}/snmp/test_snmp_unit.py
  150. +6 −7 tests/unit/{cmk_base → cmk/base}/test_autochecks.py
  151. +6 −6 tests/unit/{cmk_base → cmk/base}/test_base_crash_reporting.py
  152. +13 −13 tests/unit/{cmk_base → cmk/base}/test_caching.py
  153. +3 −3 tests/unit/{cmk_base → cmk/base}/test_check_api.py
  154. +2 −2 tests/unit/{cmk_base → cmk/base}/test_check_table.py
  155. +18 −18 tests/unit/{cmk_base → cmk/base}/test_checking.py
  156. +24 −24 tests/unit/{cmk_base → cmk/base}/test_checks.py
  157. +3 −3 tests/unit/{cmk_base → cmk/base}/test_config.py
  158. +4 −4 tests/unit/{cmk_base → cmk/base}/test_core_config.py
  159. +2 −2 tests/unit/{cmk_base → cmk/base}/test_core_nagios.py
  160. +1 −1 tests/unit/{cmk_base → cmk/base}/test_cpu_tracking.py
  161. +26 −26 tests/unit/{cmk_base → cmk/base}/test_data_sources_unit.py
  162. +1 −1 tests/unit/{cmk_base → cmk/base}/test_discovered_labels.py
  163. +3 −3 tests/unit/{cmk_base → cmk/base}/test_discovery.py
  164. +2 −2 tests/unit/{cmk_base → cmk/base}/test_host_sections.py
  165. +7 −7 tests/unit/{cmk_base → cmk/base}/test_inventory_plugins.py
  166. +1 −1 tests/unit/{cmk_base → cmk/base}/test_ip_lookup.py
  167. +1 −1 tests/unit/{cmk_base → cmk/base}/test_notify.py
  168. +1 −1 tests/unit/{cmk_base → cmk/base}/test_prediction.py
  169. +1 −1 tests/unit/{cmk_base → cmk/base}/test_snmp_utils.py
  170. +4 −4 tests/unit/{cmk_base → cmk/base}/test_unit_automations.py
  171. +1 −1 tests/unit/cmk/gui/wsgi/test_wsgi_router.py
  172. +2 −2 tests/unit/cmk/utils/rulesets/test_ruleset_matcher.py
  173. +1 −1 tests/unit/cmk/utils/rulesets/test_tuple_rulesets.py
  174. +1 −1 tests/unit/cmk/utils/test_labels.py
  175. +2 −2 tests/unit/cmk/utils/test_man_pages.py
@@ -197,15 +197,6 @@ $(DISTNAME).tar.gz: omd/packages/mk-livestatus/mk-livestatus-$(VERSION).tar.gz .
--exclude "cme.py*" \
cmk/* ; \
rm cmk/*.pyc
$(PIPENV2) run python -m compileall cmk_base ; \
tar czf $(DISTNAME)/base.tar.gz \
$(TAROPTS) \
--exclude "cee" \
--exclude "cee.py*" \
--exclude "cme" \
--exclude "cme.py*" \
cmk_base/* ; \
rm cmk_base/*.pyc
tar czf $(DISTNAME)/werks.tar.gz $(TAROPTS) -C .werks werks
tar czf $(DISTNAME)/checks.tar.gz $(TAROPTS) -C checks $$(cd checks ; ls)
tar czf $(DISTNAME)/active_checks.tar.gz $(TAROPTS) -C active_checks $$(cd active_checks ; ls)
@@ -129,7 +129,7 @@ def copy_capfile():


# Pack a directory and return the byte stream of the CAP.
# Excerpt from enterprise/cmk_base/cee/cap.py
# Excerpt from enterprise/cmk/base/cee/cap.py
def pack(install_basedir):
cap = ""
old_cwd = os.path.abspath('.')
@@ -49,18 +49,18 @@ import cmk.utils.debug
import cmk.utils.log
import cmk.utils.paths

import cmk_base # pylint: disable=cmk-module-layer-violation
import cmk_base.console as console # pylint: disable=cmk-module-layer-violation
import cmk_base.config as config # pylint: disable=cmk-module-layer-violation
import cmk_base.profiling as profiling # pylint: disable=cmk-module-layer-violation
from cmk_base.modes import modes # pylint: disable=cmk-module-layer-violation
import cmk_base.check_api as check_api # pylint: disable=cmk-module-layer-violation
import cmk_base.crash_reporting # pylint: disable=cmk-module-layer-violation
import cmk.base # pylint: disable=cmk-module-layer-violation
import cmk.base.console as console # pylint: disable=cmk-module-layer-violation
import cmk.base.config as config # pylint: disable=cmk-module-layer-violation
import cmk.base.profiling as profiling # pylint: disable=cmk-module-layer-violation
from cmk.base.modes import modes # pylint: disable=cmk-module-layer-violation
import cmk.base.check_api as check_api # pylint: disable=cmk-module-layer-violation
import cmk.base.crash_reporting # pylint: disable=cmk-module-layer-violation

cmk.utils.log.setup_console_logging()
logger = logging.getLogger("cmk.base")

cmk_base.utils.register_sigint_handler()
cmk.base.utils.register_sigint_handler()

try:
opts, args = getopt.getopt(sys.argv[1:], modes.short_getopt_specs(), modes.long_getopt_specs())
@@ -117,8 +117,8 @@ except (MKGeneralException, MKBailOut) as e:
sys.exit(3)

except Exception:
crash = cmk_base.crash_reporting.CMKBaseCrashReport.from_exception()
cmk_base.crash_reporting.CrashReportStore().save(crash)
crash = cmk.base.crash_reporting.CMKBaseCrashReport.from_exception()
cmk.base.crash_reporting.CrashReportStore().save(crash)
raise
finally:
profiling.output_profile()
@@ -26,13 +26,13 @@
from pathlib2 import Path
import six

import cmk_base.autochecks
import cmk.base.autochecks
try:
import cmk_base.cee.rrd
import cmk.base.cee.rrd
except ImportError:
raise RuntimeError("Can only be used with the Checkmk Enterprise Editions")
import cmk_base.config as config
import cmk_base.check_api as check_api
import cmk.base.config as config
import cmk.base.check_api as check_api

import cmk.utils
import cmk.utils.store as store
@@ -84,15 +84,15 @@ def get_hostnames(config_cache):

def get_info_file(hostname, servicedesc, source):
if source == 'cmc':
host_dir = cmk_base.cee.rrd.rrd_cmc_host_dir(hostname)
host_dir = cmk.base.cee.rrd.rrd_cmc_host_dir(hostname)
servicefile = cmk.utils.pnp_cleanup(servicedesc)
return os.path.join(host_dir, servicefile + '.info')
return cmk_base.cee.rrd.xml_path_for(hostname, servicedesc)
return cmk.base.cee.rrd.xml_path_for(hostname, servicedesc)


def get_metrics(filepath, source):
if source == 'cmc':
return cmk_base.cee.rrd.read_existing_metrics(filepath)
return cmk.base.cee.rrd.read_existing_metrics(filepath)

root = ET.parse(filepath).getroot()
return [x.text for x in root.findall('.//NAME')]
@@ -116,7 +116,7 @@ def update_files(args, hostname, servicedesc, item, source):
if update_condition:
if source == 'cmc':
r_metrics = ['fs_used' if x == perfvar else x for x in metrics]
cmk_base.cee.rrd.create_cmc_rrd_info_file(hostname, servicedesc, r_metrics)
cmk.base.cee.rrd.create_cmc_rrd_info_file(hostname, servicedesc, r_metrics)
else:
update_pnp_info_files(perfvar, 'fs_used', filepath)

@@ -166,7 +166,7 @@ def update_pnp_info_files(perfvar, newvar, filepath):
- Rename matching rrdfile to use newvar
- For all journal files, replace rrdfile with new file"""

rrdfile, rrdfilenew = cmk_base.cee.rrd.update_metric_pnp_xml_info_file(
rrdfile, rrdfilenew = cmk.base.cee.rrd.update_metric_pnp_xml_info_file(
perfvar, newvar, filepath)
os.rename(rrdfile, rrdfilenew)
logger.info("Renamed %s -> %s", rrdfile, rrdfilenew)
@@ -26,8 +26,9 @@


def agent_bi_arguments(params, hostname, ipaddress):
import cmk_base.data_sources.programs
return cmk_base.data_sources.programs.SpecialAgentConfiguration("", repr(params))
# TODO: Cleanup this separation violation. This should be accessed through the check API
import cmk.base.data_sources.programs
return cmk.base.data_sources.programs.SpecialAgentConfiguration("", repr(params))


special_agent_info['bi'] = agent_bi_arguments
@@ -25,13 +25,14 @@
# Boston, MA 02110-1301 USA.

import copy
import cmk_base.data_sources.programs
# TODO: Cleanup this separation violation. This should be accessed through the check API
import cmk.base.data_sources.programs


def agent_prometheus_arguments(params, _hostname, ipaddress):
prometheus_params = copy.copy(params)
prometheus_params.update({"host_address": ipaddress})
return cmk_base.data_sources.programs.SpecialAgentConfiguration("", repr(prometheus_params))
return cmk.base.data_sources.programs.SpecialAgentConfiguration("", repr(prometheus_params))


special_agent_info['prometheus'] = agent_prometheus_arguments
@@ -39,7 +39,7 @@

inv_domino_tasks_rules = []

# Deprecated option since 1.6. cmk_base creates a config warning when finding rules
# Deprecated option since 1.6. cmk.base creates a config warning when finding rules
# for this ruleset. Can be dropped with 1.7.
inv_domino_tasks = []

@@ -31,7 +31,7 @@
# datasources can be defined in Check_MK natively. Therefore we shift
# the detection of the duplicate services directly to this check.
# When it is possible to handle duplicate services for different
# datasources correctly at the cmk_base level this code can be removed.
# datasources correctly at the cmk.base level this code can be removed.
# NOTE: By design the extra_sections are passed to EVERY subcheck and
# therefore have to be removed in every subcheck!
# Change-Id: I3b6a56efcff4c75bbd05a051242e18deaa499d9e
@@ -268,8 +268,9 @@ def fileinfo_groups_precompile(hostname, item, params):
if group_name_pattern == item:
patterns.append(pattern)

import cmk_base.checking
precomped = cmk_base.checking.determine_check_params(params).copy()
# TODO: Cleanup this separation violation. This should be accessed through the check API
import cmk.base.checking
precomped = cmk.base.checking.determine_check_params(params).copy()
precomped['precompiled_patterns'] = patterns
return precomped

@@ -82,7 +82,7 @@ def _parse_perfentry(entry):
'''parse single perfdata entry
return a named tuple containing check_levels compatible levels field, as well as
cmk_base compatible perfdata 6-tuple.
cmk.base compatible perfdata 6-tuple.
This function may raise Index- or ValueErrors.
'''
@@ -41,7 +41,7 @@ logwatch_max_filesize = 500000 # do not save more than 500k of message (configu
logwatch_service_output = "default"
logwatch_groups = []

# Deprecated option since 1.6. cmk_base creates a config warning when finding rules
# Deprecated option since 1.6. cmk.base creates a config warning when finding rules
# for this ruleset. Can be dropped with 1.7.
logwatch_patterns = {}

@@ -71,7 +71,7 @@
# 4. levels: four numbers (thresholds)
inventory_processes_rules = []

# Deprecated option since 1.6. cmk_base creates a config warning when finding rules
# Deprecated option since 1.6. cmk.base creates a config warning when finding rules
# for this ruleset. Can be dropped with 1.7.
inventory_processes = []

@@ -40,7 +40,7 @@
# BITS running/demand Intelligenter Hintergrund<FC>bertragungsdienst
# Bonjour_Service running/auto Dienst "Bonjour"

# Deprecated option since 1.6. cmk_base creates a config warning when finding rules
# Deprecated option since 1.6. cmk.base creates a config warning when finding rules
# for this ruleset. Can be dropped with 1.7.
inventory_services = []

@@ -0,0 +1,31 @@
#!/bin/bash
set -e

SITE=${SITE:-$(until [ $PWD == / ]; do if [ -e .site ]; then
cat .site
break
else cd ..; fi; done)}
SITE=${SITE:-$(omd sites --bare | head -n 1)}
ROOT=/omd/sites/$SITE

echo "Update site $SITE..."

echo "Copy CRE files..."
sudo rsync \
--exclude=cee \
--exclude=cee.py \
--exclude=cme.py \
-a * $ROOT/lib/python/cmk/base/
sudo pycompile -q $ROOT/lib/python/cmk/base

# Also deploy all other directories of same type
if [ ${ALL_EDITIONS:-1} != 0 ]; then
for WHAT in enterprise managed; do
if [ -e ../../$WHAT/cmk/base/.f12 ]; then
(
cd ../../$WHAT/cmk/base
ONLY_COPY=1 ALL_EDITIONS=0 bash .f12
)
fi
done
fi
@@ -28,14 +28,14 @@
discovery and a lot of other functionality."""

import sys
import cmk_base.caching
from .caching import CacheManager

# This cache manager holds all caches that rely on the configuration
# and have to be flushed once the configuration is reloaded in the
# keepalive mode
config_cache = cmk_base.caching.CacheManager()
config_cache = CacheManager()

# These caches are not automatically cleared during the whole execution
# time of the current Check_MK process. Single cached may be cleaned
# manually during execution.
runtime_cache = cmk_base.caching.CacheManager()
runtime_cache = CacheManager()
File renamed without changes.
@@ -38,13 +38,13 @@
from cmk.utils.exceptions import MKGeneralException
from cmk.utils.encoding import convert_to_unicode

import cmk_base.config as config
import cmk_base.console
from cmk_base.discovered_labels import (
import cmk.base.config as config
import cmk.base.console
from cmk.base.discovered_labels import (
DiscoveredServiceLabels,
ServiceLabel,
)
from cmk_base.check_utils import ( # pylint: disable=unused-import
from cmk.base.check_utils import ( # pylint: disable=unused-import
CheckPluginName, CheckParameters, DiscoveredService, Item, Service,
)

@@ -144,20 +144,20 @@ def _read_raw_autochecks_of(self, hostname):

check_config = config.get_check_variables()
try:
cmk_base.console.vverbose("Loading autochecks from %s\n", filepath)
cmk.base.console.vverbose("Loading autochecks from %s\n", filepath)
autochecks_raw = eval(
open(filepath).read().decode("utf-8"), check_config,
check_config) # type: List[Dict]
except SyntaxError as e:
cmk_base.console.verbose("Syntax error in file %s: %s\n",
cmk.base.console.verbose("Syntax error in file %s: %s\n",
filepath,
e,
stream=sys.stderr)
if cmk.utils.debug.enabled():
raise
return result
except Exception as e:
cmk_base.console.verbose("Error in file %s:\n%s\n", filepath, e, stream=sys.stderr)
cmk.base.console.verbose("Error in file %s:\n%s\n", filepath, e, stream=sys.stderr)
if cmk.utils.debug.enabled():
raise
return result
@@ -35,11 +35,11 @@
from cmk.utils.encoding import make_utf8
from cmk.utils.exceptions import MKException

import cmk_base.utils
import cmk_base.config as config
import cmk_base.console as console
import cmk_base.profiling as profiling
import cmk_base.check_api as check_api
import cmk.base.utils
import cmk.base.config as config
import cmk.base.console as console
import cmk.base.profiling as profiling
import cmk.base.check_api as check_api


# TODO: Inherit from MKGeneralException

0 comments on commit 0ad3357

Please sign in to comment.
You can’t perform that action at this time.