Module: check_mk
Branch: master
Commit: 25ab24eb296e0beda63d6bbdb798b77acbaa7c46
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=25ab24eb296e0b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Aug 5 09:40:30 2016 +0200
3760 FIX Cluster nodes can not be nodes of their own anymore
---
.werks/3760 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 3 +++
3 files changed, 13 insertions(+)
diff --git a/.werks/3760 b/.werks/3760
new file mode 100644
index 0000000..92f1b23
--- /dev/null
+++ b/.werks/3760
@@ -0,0 +1,9 @@
+Title: Cluster nodes can not be nodes of their own anymore
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i1
+Date: 1470382816
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index e446c47..7dd4a7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -530,6 +530,7 @@
* 3755 FIX: Preventing to insert non ASCII characters in host addresses now
* 3756 FIX: Bulk import: Fixed exception when host name contained special characters
* 3757 FIX: Bulk import: Ensuring non ASCII characters are not imported into regular
attributes
+ * 3760 FIX: Cluster nodes can not be nodes of their own anymore
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index ca8bb11..6e3277d 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1341,6 +1341,9 @@ def action_edit_host(mode, hostname, is_cluster):
if len(cluster_nodes) < 1:
raise MKUserError("nodes_0", _("The cluster must have at least
one node"))
for nr, cluster_node in enumerate(cluster_nodes):
+ if cluster_node == hostname:
+ raise MKUserError("nodes_%d" % nr, _("The cluster can not
be a node of it's own"))
+
if not Host.host_exists(cluster_node):
raise MKUserError("nodes_%d" % nr, _("The node
<b>%s</b> does not exist "
" (must be a host that is configured with
WATO)") % cluster_node)