From 4877bdccf13d8150f7a9a7a52b9578298678bc9c Mon Sep 17 00:00:00 2001 From: 0xdcarns Date: Thu, 29 Dec 2022 10:57:25 -0500 Subject: [PATCH] add mq removal on host delete --- controllers/hosts.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/controllers/hosts.go b/controllers/hosts.go index 47663ccd..4a27a0cd 100644 --- a/controllers/hosts.go +++ b/controllers/hosts.go @@ -130,6 +130,10 @@ func deleteHost(w http.ResponseWriter, r *http.Request) { return } + if err = mq.DeleteMqClient(currHost.ID.String()); err != nil { + logger.Log(0, "error removing DynSec credentials for host:", currHost.Name, err.Error()) + } + apiHostData := currHost.ConvertNMHostToAPI() logger.Log(2, r.Header.Get("user"), "removed host", currHost.Name) w.WriteHeader(http.StatusOK)