Module: check_mk
Branch: master
Commit: fbbd28fd4ffad2701f7326791be8d4d6f9ce1ce4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fbbd28fd4ffad2…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 27 11:47:21 2015 +0100
Agent deployment: delete-host also cleans up deployment state
---
modules/automation.py | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/modules/automation.py b/modules/automation.py
index 23d5bc6..ba5d386 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -362,15 +362,17 @@ def automation_delete_host(args):
# single files
for path in [
- "%s/%s" % (precompiled_hostchecks_dir, hostname),
- "%s/%s.py" % (precompiled_hostchecks_dir, hostname),
- "%s/%s.mk" % (autochecksdir, hostname),
- "%s/%s" % (counters_directory, hostname),
- "%s/%s" % (tcp_cache_dir, hostname),
- "%s/persisted/%s" % (var_dir, hostname),
- "%s/piggyback/%s" % (tmp_dir, hostname),
- "%s/inventory/%s" % (var_dir, hostname),
- "%s/inventory/%s.gz" % (var_dir, hostname)]:
+ "%s/%s" % (precompiled_hostchecks_dir, hostname),
+ "%s/%s.py" % (precompiled_hostchecks_dir, hostname),
+ "%s/%s.mk" % (autochecksdir, hostname),
+ "%s/%s" % (counters_directory, hostname),
+ "%s/%s" % (tcp_cache_dir, hostname),
+ "%s/persisted/%s" % (var_dir, hostname),
+ "%s/piggyback/%s" % (tmp_dir, hostname),
+ "%s/inventory/%s" % (var_dir, hostname),
+ "%s/inventory/%s.gz" % (var_dir, hostname),
+ "%s/agent_deployment/%s" % (var_dir, hostname),
+ ]:
if os.path.exists(path):
os.unlink(path)
@@ -384,6 +386,7 @@ def automation_delete_host(args):
if os.path.exists("%s/%s" % (folder, hostname)):
os.unlink("%s/%s" % (folder, hostname))
+
# logwatch folders
if os.path.exists("%s/%s" % (logwatch_dir, hostname)):
import shutil