Module: check_mk
Branch: master
Commit: 70e94b07f5817d9249717453ae2bf960656e1e28
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=70e94b07f5817d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 23 15:46:36 2015 +0200
#2691 FIX Fixed exception in host address painter when displaying hosts/services of older
sites
---
.werks/2691 | 10 ++++++++++
ChangeLog | 1 +
web/plugins/views/painters.py | 12 ++++++------
3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/.werks/2691 b/.werks/2691
new file mode 100644
index 0000000..d0d7cef
--- /dev/null
+++ b/.werks/2691
@@ -0,0 +1,10 @@
+Title: Fixed exception in host address painter when displaying hosts/services of older
sites
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1445607971
+
+
diff --git a/ChangeLog b/ChangeLog
index 3465668..44c76d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@
* 2687 FIX: Quicksearch: Improved error handling
* 2689 FIX: LDAP: Fixed broken sync when using "Filter Group" in the user
sync settings
* 2438 FIX: Manpage icons: fixed manpage links for active checks
+ * 2691 FIX: Fixed exception in host address painter when displaying hosts/services of
older sites
WATO:
* 2666 FIX: Fix search for global configuration variables: ignore case now
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 77c53af..901f628 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -1369,11 +1369,11 @@ def paint_host_addresses(row):
row["host_custom_variable_values"]))
if custom_vars.get("ADDRESS_FAMILY", "4") == "4":
- primary = custom_vars["ADDRESS_4"]
- secondary = custom_vars["ADDRESS_6"]
+ primary = custom_vars.get("ADDRESS_4", "")
+ secondary = custom_vars.get("ADDRESS_6", "")
else:
- primary = custom_vars["ADDRESS_6"]
- secondary = custom_vars["ADDRESS_4"]
+ primary = custom_vars.get("ADDRESS_6", "")
+ secondary = custom_vars.get("ADDRESS_4", "")
if secondary:
secondary = " (%s)" % secondary
@@ -1402,9 +1402,9 @@ def paint_host_address_families(row):
primary = custom_vars.get("ADDRESS_FAMILY", "4")
families = [primary]
- if primary == "6" and custom_vars["ADDRESS_4"]:
+ if primary == "6" and custom_vars.get("ADDRESS_4"):
families.append("4")
- elif primary == "4" and custom_vars["ADDRESS_6"]:
+ elif primary == "4" and custom_vars.get("ADDRESS_6"):
families.append("6")
return "", ", ".join(families)