From: Gunnar Beutner Date: Sun, 13 Apr 2014 09:11:55 +0000 (+0200) Subject: Make sure that icinga2-forget-agent removes the .peer file. X-Git-Tag: v0.0.10~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb02426ce198ad5d7952c599a68ddb9eab787167;p=icinga2 Make sure that icinga2-forget-agent removes the .peer file. Refs #6002 --- 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)