Module: check_mk
Branch: master
Commit: f0dd6aaf7c8406bde2f205d0bbe9755d707cedf4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f0dd6aaf7c8406…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Apr 6 17:38:13 2016 +0200
3373 FIX Fixed exception when handling syntax errors while loading pagetype files
---
.werks/3373 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/pagetypes.py | 6 ++++--
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/3373 b/.werks/3373
new file mode 100644
index 0000000..f542142
--- /dev/null
+++ b/.werks/3373
@@ -0,0 +1,9 @@
+Title: Fixed exception when handling syntax errors while loading pagetype files
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.9i1
+Date: 1459957038
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 347830c..8a3c0db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -177,6 +177,7 @@
* 3364 FIX: Fixed exception when creating a view of a single log entry...
* 3326 FIX: Fixed white text on white background in mobile GUI
* 3327 FIX: Disallow scheduling downtimes with an end date that is before the start
date
+ * 3373 FIX: Fixed exception when handling syntax errors while loading pagetype files
WATO:
* 3244 WATO BI Module: swap order of aggregation function and child node
selection...
diff --git a/web/htdocs/pagetypes.py b/web/htdocs/pagetypes.py
index 304aa1f..34d0977 100644
--- a/web/htdocs/pagetypes.py
+++ b/web/htdocs/pagetypes.py
@@ -655,7 +655,8 @@ class Overridable(Base):
self.add_instance((user, name), self(page_dict))
except SyntaxError, e:
- raise MKGeneralException(_("Cannot load %s from %s: %s") %
(what, path, e))
+ raise MKGeneralException(_("Cannot load %s from %s: %s") %
+ (self.type_name(), path, e))
# FIXME: Better switch to "new style classes" and use super() and then
override load()
# in the subclass. Brings more flexibility.
@@ -663,7 +664,8 @@ class Overridable(Base):
self._load()
# Declare permissions - one for each of the pages, if it is public
- config.declare_permission_section(self.type_name(),
self.phrase("title_plural"), do_sort = True)
+ config.declare_permission_section(self.type_name(),
self.phrase("title_plural"),
+ do_sort = True)
for instance in self.instances():
if instance.is_public():