[checkmk-commits] Check_MK Git: check_mk: #1986 FIX Added nicer error message when calling the rename host page with a non existant host

Lars Michelsen lm at mathias-kettner.de
Fri Feb 20 10:05:58 CET 2015


Module: check_mk
Branch: master
Commit: 396758ad1fc9c38b27552853445adf79d8a445d8
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=396758ad1fc9c38b27552853445adf79d8a445d8

Author: Lars Michelsen <lm at mathias-kettner.de>
Date:   Fri Feb 20 10:05:52 2015 +0100

#1986 FIX Added nicer error message when calling the rename host page with a non existant host

---

 .werks/1986        |   10 ++++++++++
 ChangeLog          |    1 +
 web/htdocs/wato.py |    4 ++++
 3 files changed, 15 insertions(+)

diff --git a/.werks/1986 b/.werks/1986
new file mode 100644
index 0000000..f544e00
--- /dev/null
+++ b/.werks/1986
@@ -0,0 +1,10 @@
+Title: Added nicer error message when calling the rename host page with a non existant host
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1424423142
+
+
diff --git a/ChangeLog b/ChangeLog
index 8962157..ebecf56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -238,6 +238,7 @@
     * 1925 FIX: Fix missing auxilliary tags that have their own topic...
     * 1927 FIX: Fixed level description in WATO rules, change from if above into at
     * 1976 FIX: Sorting BI rule choice dropdown field entries now
+    * 1986 FIX: Added nicer error message when calling the rename host page with a non existant host
 
     Notifications:
     * 1662 notification plugin spectrum: finalized script. now able to handle host notications
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index d20c9ba..2258c2f 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2217,6 +2217,10 @@ def check_edit_host_permissions(folder, host, hostname):
 
 def mode_rename_host(phase):
     hostname = html.var("host")
+
+    if hostname not in g_folder[".hosts"]:
+        raise MKGeneralException(_("You called this page with an invalid host name."))
+
     host = g_folder[".hosts"][hostname]
     is_cluster = ".nodes" in host
 



More information about the checkmk-commits mailing list