minor adjustments
This commit is contained in:
@@ -164,7 +164,14 @@ func (h *Handler) VmModifyEvent(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if err != nil {
|
||||
h.Logger.Error("unable to find existing inventory record for this VM", "error", err)
|
||||
// TODO - how to handle?
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
json.NewEncoder(w).Encode(map[string]string{
|
||||
"status": "ERROR",
|
||||
"message": fmt.Sprintf("Valid request but could not locate vm id '%s' and datacenter name '%s' within inventory table : %s",
|
||||
event.CloudEvent.Data.VM.VM.Value, event.CloudEvent.Data.Datacenter.Name, err),
|
||||
})
|
||||
return
|
||||
} else {
|
||||
params.InventoryId = sql.NullInt64{Int64: invResult.Iid, Valid: invResult.Iid > 0}
|
||||
}
|
||||
|
Reference in New Issue
Block a user