Module: check_mk
Branch: master
Commit: a28b14611dcb16efaaecc0425911b03897ab505d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a28b14611dcb16…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 21 16:37:26 2016 +0100
3338 FIX Improved error handling when host to be edited does not exist
---
.werks/3338 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 5 ++++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/3338 b/.werks/3338
new file mode 100644
index 0000000..ce91d87
--- /dev/null
+++ b/.werks/3338
@@ -0,0 +1,10 @@
+Title: Improved error handling when host to be edited does not exist
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1458574630
+
+
diff --git a/ChangeLog b/ChangeLog
index c10db31..208bba8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -165,6 +165,7 @@
* 3314 FIX: Correctly add custom user attribute values after change in attribute
declaration...
* 3316 FIX: Fix validation of empty or missing file uploads (such as in Bulk host
import)
* 3302 FIX: Improved error handling when trying to edit a not existing rule
+ * 3338 FIX: Improved error handling when host to be edited does not exist
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 02b4dcc..ffdc7d6 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1180,7 +1180,10 @@ def mode_edit_host(phase, new, is_cluster):
is_cluster = host.is_cluster()
# edit
- elif not new and Folder.current().has_host(hostname):
+ elif not new:
+ if not Folder.current().has_host(clonename):
+ raise MKGeneralException(_("You called this page with an invalid host
name."))
+
mode = "edit"
title = _("Properties of host") + " " + hostname
host = Folder.current().host(hostname)