Module: check_mk
Branch: master
Commit: e6754761cef8ba222168690939b00a897bc36ab0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e6754761cef8ba…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 27 08:31:50 2016 +0100
#2964 FIX Deleting site having hosts assigned links to list of hosts now
---
.werks/2964 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 13 +++++++++++--
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/.werks/2964 b/.werks/2964
new file mode 100644
index 0000000..a99279c
--- /dev/null
+++ b/.werks/2964
@@ -0,0 +1,9 @@
+Title: Deleting site having hosts assigned links to list of hosts now
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453879900
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 0895767..be46edd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -299,6 +299,7 @@
* 2943 FIX: Preventing issues with password completion of browsers on user and
profile edit pages
* 2831 FIX: Removing a previously set custom attribute for a contact did not work as
intented...
* 2973 FIX: showing subfolder info in WATO if there are more than four groups
+ * 2964 FIX: Deleting site having hosts assigned links to list of hosts now
Notifications:
* 2811 Mail notifications: Now able to add Host/Service Notes Url...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 10a7745..76f7d9b 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8805,9 +8805,18 @@ def mode_sites(phase):
if is_distributed(test_sites):
# Make sure that site is not being used by hosts and folders
if delid in Folder.root_folder().all_site_ids():
+ search_url = html.makeactionuri([
+ ("_change_site", "1"),
+ ("host_search_site", delid),
+ ("host_search", "1"),
+ ("folder", ""),
+ ("mode", "search"),
+ ("filled_in", "edit_host"),
+ ])
raise MKUserError(None,
- _("You cannot delete this connection. "
- "It has folders/hosts assigned to it."))
+ _("You cannot delete this connection. It has folders/hosts
"
+ "assigned to it. You can use the <a
href=\"%s\">host "
+ "search</a> to get a list of the hosts.") %
search_url)
c = wato_confirm(_("Confirm deletion of site %s" % delid),
_("Do you really want to delete the connection to the
site %s?" % delid))