Module: check_mk
Branch: master
Commit: ed39da0391c46b87abad46490cf8ca5b7349ad22
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ed39da0391c46b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Apr 6 16:03:38 2016 +0200
3371 FIX Be compatible to old site=None setting read from hosts.mk
Old WATO versions saved the site attribute with a value of None which
is not allowed in current WATO versions. Either the key has to be missing
when no specific site is configured or the key has to be missing. Cleaned
this up.
Fixed exception: TypeError (cannot concatenate 'str' and 'NoneType'
objects)
---
.werks/3371 | 15 +++++++++++++++
ChangeLog | 1 +
web/htdocs/watolib.py | 10 +++++++---
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/.werks/3371 b/.werks/3371
new file mode 100644
index 0000000..d7f0b3a
--- /dev/null
+++ b/.werks/3371
@@ -0,0 +1,15 @@
+Title: Be compatible to old site=None setting read from hosts.mk
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1459951352
+
+Old WATO versions saved the site attribute with a value of None which
+is not allowed in current WATO versions. Either the key has to be missing
+when no specific site is configured or the key has to be missing. Cleaned
+this up.
+
+Fixed exception: TypeError (cannot concatenate 'str' and 'NoneType'
objects)
diff --git a/ChangeLog b/ChangeLog
index 5ae17e6..8577fb0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -231,6 +231,7 @@
* 3365 FIX: Cleaned up wrong counting of parents when renaming a host
* 3366 FIX: Fixed renaming of hosts not updating parents configured in folders
* 3369 FIX: Printing configuration warning when host references itself as parent
+ * 3371 FIX: Be compatible to old site=None setting read from hosts.mk...
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index a5822e3..c595121d9 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -754,10 +754,14 @@ class Folder(BaseFolder):
if host_name in variables["host_attributes"]:
attributes = variables["host_attributes"][host_name]
- # Otherwise it is in import from some manual old version of from some
- # CMDB and we reconstruct the attributes. That way the folder inheritance
- # information is not available and all tags are set explicitely
+ # Old WATO was saving "site" attribute with value of None. Skip
this key.
+ if "site" in attributes and attributes["site"] == None:
+ del attributes["site"]
+
else:
+ # Otherwise it is an import from some manual old version of from some
+ # CMDB and we reconstruct the attributes. That way the folder inheritance
+ # information is not available and all tags are set explicitely
attributes = {}
alias = self._get_alias_from_extra_conf(host_name, variables)
if alias != None: