Module: check_mk
Branch: master
Commit: c7f66c2d6c73e08cc69703a0fd19b6b41b8dfb87
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c7f66c2d6c73e0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jan 9 12:03:42 2012 +0100
FIX: Fixed "move to target folders" after CSV import
---
.f12 | 13 +++++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 7 ++++++-
3 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/.f12 b/.f12
new file mode 100644
index 0000000..2a88411
--- /dev/null
+++ b/.f12
@@ -0,0 +1,13 @@
+#!/bin/bash
+SITE=${SITE:-$(omd sites --bare | head -n 1)}
+set -xe
+
+sed -e "s#@BINDIR@#/omd/sites/$SITE/bin#g" \
+ -e "s#@VARDIR@#/omd/sites/$SITE/var/check_mk#g" \
+ -e "s#@CHECK_ICMP@#/omd/sites/$SITE/lib/nagios/plugins/check_icmp#g" \
+ -e "s#@PNPURL@#/$SITE/pnp4nagios/#g" \
+ -e "s#@CGIURL@#/$SITE/nagios/cgi-bin#g" \
+ < check_mk_templates.cfg > /tmp/check_mk_templates.cfg
+
+sudo mv /tmp/check_mk_templates.cfg /omd/sites/$SITE/etc/nagios/conf.d
+sudo omd restart $SITE nagios
diff --git a/ChangeLog b/ChangeLog
index bb8fd2c..11994de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,7 @@
WATO:
* FIX: Fixed missing folders in "move to" dropdown fields
+ * FIX: Fixed "move to target folders" after CSV import
BI:
* improve doc/treasures/check_bi_local.py: local check that creates
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 049853f..71089dd 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -71,6 +71,8 @@
# performance issues.
# ".total_hosts" -> recursive number of hosts, computed on demand by
# num_hosts_in()
+# ".siteid" -> This attribute is mandatory for host objects and
optional for folder
+# objects. In case of hosts and single WATO setup it is always
none.
#
#
# g_folder -> The folder object representing the folder the user is
@@ -2152,8 +2154,11 @@ def create_target_folder_from_aliaspath(aliaspath):
".folders" : {},
".files" : {},
".parent" : folder,
- ".siteid" : folder[".siteid"],
}
+
+ if '.siteid' in folder:
+ new_folder['.siteid'] = folder[".siteid"]
+
folder[".folders"][name] = new_folder
g_folders[new_path] = new_folder
folder = new_folder