Module: check_mk
Branch: master
Commit: 0c42be56edcc47c1cf8d668f5d63f014c74faa9b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0c42be56edcc47…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 4 09:54:55 2014 +0100
#1620 FIX Fixed exception during host renaming when host has no perfdata
---
.werks/1620 | 9 +++++++++
ChangeLog | 1 +
modules/automation.py | 3 +--
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/.werks/1620 b/.werks/1620
new file mode 100644
index 0000000..c0b0a65
--- /dev/null
+++ b/.werks/1620
@@ -0,0 +1,9 @@
+Title: Fixed exception during host renaming when host has no perfdata
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417683278
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 246f486..c4b23fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -159,6 +159,7 @@
* 1576 FIX: SNMP Community host attribute is now visible for IE<=8...
* 1588 FIX: Renamed SNMP communities rule to SNMP credentials
* 1589 FIX: Restructured SNMP credentials rule specification...
+ * 1620 FIX: Fixed exception during host renaming when host has no perfdata
Notifications:
* 1512 Bulk notification can now be grouped according to custom macro values...
diff --git a/modules/automation.py b/modules/automation.py
index 61e3207..21dad73 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -1010,13 +1010,12 @@ def omd_rename_host(oldname, newname):
# Fix pathnames in XML files
dirpath = omd_root + "/var/pnp4nagios/perfdata/" + oldname
- os.system("sed -i 's@/perfdata/%s/@/perfdata/%s/@' %s/*.xml" %
(oldname, newname, dirpath))
+ os.system("sed -i 's@/perfdata/%s/@/perfdata/%s/@' %s/*.xml
2>/dev/null" % (oldname, newname, dirpath))
# RRD files
if rename_host_dir(rrd_path, oldname, newname):
actions.append("rrd")
-
# entries of rrdcached journal
dirpath = omd_root + "/var/rrdcached/"
if not os.system("sed -i 's@/perfdata/%s/@/perfdata/%s/@' "