From bb02426ce198ad5d7952c599a68ddb9eab787167 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 13 Apr 2014 11:11:55 +0200 Subject: [PATCH] Make sure that icinga2-forget-agent removes the .peer file. Refs #6002 --- tools/icinga2-forget-agent.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/icinga2-forget-agent.cmake b/tools/icinga2-forget-agent.cmake index 42d2b74bd..f33bc4cd1 100644 --- a/tools/icinga2-forget-agent.cmake +++ b/tools/icinga2-forget-agent.cmake @@ -36,5 +36,10 @@ if not os.path.isfile(inventory_file): os.unlink(inventory_file) +peer_file = "@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/lib/icinga2/agent/inventory/" + hashlib.sha256(cn).hexdigest() + ".peer" + +if os.path.isfile(peer_file): + os.unlink(peer_file) + print("Inventory information has been removed for agent '%s'." % (cn)) sys.exit(0) -- 2.40.0