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) diff --git a/models/api_node.go b/models/api_node.go index b225c861..88816ab8 100644 --- a/models/api_node.go +++ b/models/api_node.go @@ -113,7 +113,7 @@ func (a *ApiNode) ConvertToServerNode(currentNode *Node) *Node { func (nm *Node) ConvertToAPINode() *ApiNode { apiNode := ApiNode{} apiNode.ID = nm.ID.String() - apiNode.HostID = nm.ID.String() + apiNode.HostID = nm.HostID.String() apiNode.Address = nm.Address.String() if isEmptyAddr(apiNode.Address) { apiNode.Address = ""