]> granicus.if.org Git - icinga2/blobdiff - tools/icinga2-forget-agent.cmake
Migration: Remove broken script, update documentation for work-in-progress.
[icinga2] / tools / icinga2-forget-agent.cmake
index 8cabe8832c4cf425b00311341a63e4a16b620bc0..f33bc4cd14ceaf14b8d14c29eea29df854f438d5 100644 (file)
@@ -31,10 +31,15 @@ cn = sys.argv[1]
 inventory_file = "@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/lib/icinga2/agent/inventory/" + hashlib.sha256(cn).hexdigest()
 
 if not os.path.isfile(inventory_file):
-    warning("There's no inventory file for agent '%s'.")
+    warning("There's no inventory file for agent '%s'." % (cn))
     sys.exit(0)
 
 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)