Module: check_mk
Branch: master
Commit: 841be7b98c74336d53ba2e8e0a6de3ae0a6fdb69
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=841be7b98c7433…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 22 20:33:54 2016 +0100
Moved cap package format handling to cmk_base module
---
cmk_base/cee | 1 +
modules/check_mk.py | 8 +++++---
tests/conftest.py | 1 +
tests/testlib/pylint_cmk.py | 1 -
4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/cmk_base/cee b/cmk_base/cee
new file mode 120000
index 0000000..8c843cc
--- /dev/null
+++ b/cmk_base/cee
@@ -0,0 +1 @@
+../../cmc/cmk_base/cee
\ No newline at end of file
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 5af77ff..5689bb9 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -271,7 +271,7 @@ config_variable_names = set(vars().keys()).difference(known_vars)
# at check time (and many of what is also needed at administration time).
try:
modules = [ 'check_mk_base', 'discovery', 'snmp',
'notify', 'events',
- 'alert_handling', 'cmc', 'inline_snmp',
'agent_bakery', 'cap' ]
+ 'alert_handling', 'cmc', 'inline_snmp',
'agent_bakery' ]
for module in modules:
if module_exists(module):
load_module(module)
@@ -4741,10 +4741,12 @@ try:
done = True
elif o == '--cap':
- if 'do_cap' not in globals():
+ try:
+ import cmk_base.cee.cap
+ except ImportError:
raise MKBailOut("Agent packages are not supported by your version of
Check_MK.")
- do_cap(args)
+ cmk_base.cee.cap.do_cap(args)
done = True
elif o in [ '--show-snmp-stats' ]:
diff --git a/tests/conftest.py b/tests/conftest.py
index 79c83c2..7d9818c 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -27,6 +27,7 @@ def add_python_paths():
sys.path.insert(0, os.path.dirname(__file__))
# make the repo directory available (cmk lib)
sys.path.insert(0, cmk_path())
+ sys.path.insert(0, cmc_path())
print("Import path: %s" % " ".join(sys.path))
diff --git a/tests/testlib/pylint_cmk.py b/tests/testlib/pylint_cmk.py
index a21c22e..ba84684 100644
--- a/tests/testlib/pylint_cmk.py
+++ b/tests/testlib/pylint_cmk.py
@@ -32,7 +32,6 @@ def ordered_module_files():
"../cmc/modules/cmc.py",
"../cmc/modules/inline_snmp.py",
"../cmc/modules/agent_bakery.py",
- "../cmc/modules/cap.py",
"../cmc/modules/rrd.py",
]