Module: check_mk
Branch: master
Commit: db86c1ccfbe9a843e3029f0007ca7a48f1bd5237
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=db86c1ccfbe9a8…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 19 13:13:42 2016 +0100
#2926 FIX Fix exception in WATO when a check man page has not catalog entry
---
.bugs/849 | 7 ++++---
.werks/2926 | 9 +++++++++
ChangeLog | 1 +
modules/check_mk.py | 16 +++++++---------
4 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/.bugs/849 b/.bugs/849
index af867e8..3a49909 100644
--- a/.bugs/849
+++ b/.bugs/849
@@ -1,8 +1,9 @@
Title: Manpage without Catalog breaks Check Plugins Section in Wato
Component: wato
-State: open
+Class: bug
+State: done
Date: 2015-08-05 11:04:58
Targetversion: 1.2.7
-Class: bug
-See topic
\ No newline at end of file
+See topic
+2016-01-19 13:13:20: changed state open -> done
diff --git a/.werks/2926 b/.werks/2926
new file mode 100644
index 0000000..eb67489
--- /dev/null
+++ b/.werks/2926
@@ -0,0 +1,9 @@
+Title: Fix exception in WATO when a check man page has not catalog entry
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453205601
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index d1341f3..e315a64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
* 2770 FIX: Check_MK is now warning the user about deprecated but configured
checkgroup parameters...
* 2848 FIX: Fixed cleanup of old autocheck files of cluster hosts...
* 2894 FIX: Fixed broken cluster checks when using Nagios core...
+ * 2926 FIX: Fix exception in WATO when a check man page has not catalog entry
Checks & Agents:
* 2434 NetApp monitoring: Cluster-Mode is now supported, changes in existing 7Mode
checks...
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 74361b0..3e52e02 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2337,6 +2337,7 @@ def list_all_manuals():
table.sort()
print_table(['Check type', 'Title'], [tty_bold, tty_normal], table)
+
def read_manpage_catalog():
load_module("catalog")
global g_manpage_catalog
@@ -2351,18 +2352,12 @@ def read_manpage_catalog():
except Exception, e:
if opt_debug:
raise
- sys.stderr.write('ERROR: Skipping invalid manpage: %s: %s\n' %
(checkname, e))
+ raise MKGeneralException('ERROR: Skipping invalid manpage: %s: %s\n'
% (checkname, e))
continue
- try:
+ if "catalog" in parsed:
cat = parsed["catalog"]
- except KeyError:
- if opt_debug:
- raise
- sys.stderr.write('ERROR: Skipping invalid manpage: %s (Catalog info
missing)\n' % checkname)
- continue
-
- if not cat:
+ else:
cat = [ "unsorted" ]
if cat[0] == "os":
@@ -2554,7 +2549,10 @@ def load_manpage(checkname):
header[key] = value.strip()
header["agents"] = [ a.strip() for a in
header["agents"].split(",") ]
+ if 'catalog' not in header:
+ header['catalog'] = [ 'unsorted' ]
sections['header'] = header
+
return sections