Module: check_mk
Branch: master
Commit: 562ea597ad1bc75c632d75fabceecb1d95c57a8f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=562ea597ad1bc7…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Sep 27 13:58:08 2016 +0200
3881 fixed automation call 'delete piggyback host'
---
.werks/3881 | 10 ++++++++++
ChangeLog | 1 +
modules/automation.py | 11 ++++++-----
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/.werks/3881 b/.werks/3881
new file mode 100644
index 0000000..055fcb3
--- /dev/null
+++ b/.werks/3881
@@ -0,0 +1,10 @@
+Title: fixed automation call 'delete piggyback host'
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1474977036
+
+
diff --git a/ChangeLog b/ChangeLog
index a95239d..49c19f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -643,6 +643,7 @@
* 3760 FIX: Cluster nodes can not be nodes of their own anymore
* 3844 FIX: Fixed validation of host IPv4, IPv6 and management host address
attributes...
* 3845 FIX: Added missing validation of host attribute values to WATO Web API calls
+ * 3881 FIX: fixed automation call 'delete piggyback host'
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/modules/automation.py b/modules/automation.py
index 5685d2d..3f4354c 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -401,7 +401,6 @@ def delete_host_files(hostname):
"%s/%s" % (cmk.paths.counters_dir, hostname),
"%s/%s" % (cmk.paths.tcp_cache_dir, hostname),
"%s/persisted/%s" % (cmk.paths.var_dir, hostname),
- "%s/piggyback/%s" % (cmk.paths.tmp_dir, hostname),
"%s/inventory/%s" % (cmk.paths.var_dir, hostname),
"%s/inventory/%s.gz" % (cmk.paths.var_dir, hostname),
"%s/agent_deployment/%s" % (cmk.paths.var_dir, hostname),
@@ -422,10 +421,12 @@ def delete_host_files(hostname):
if os.path.exists("%s/%s" % (folder, hostname)):
os.unlink("%s/%s" % (folder, hostname))
- # logwatch folders
- if os.path.exists("%s/%s" % (cmk.paths.logwatch_dir, hostname)):
- import shutil
- shutil.rmtree("%s/%s" % (cmk.paths.logwatch_dir, hostname))
+ # logwatch and piggyback folders
+ import shutil
+ for what_dir in [ "%s/%s" % (cmk.paths.logwatch_dir, hostname),
+ "%s/piggyback/%s" % (cmk.paths.tmp_dir, hostname), ]:
+ if os.path.exists(what_dir):
+ shutil.rmtree(what_dir)
return None