more cleanup
This commit is contained in:
@@ -41,7 +41,8 @@ func (h *Handler) VmModify(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if event.CloudEvent.Data.ConfigChanges == nil {
|
if event.CloudEvent.Data.ConfigChanges == nil {
|
||||||
h.Logger.Debug("Received event contains no config change")
|
h.Logger.Warn("Received event contains no config change")
|
||||||
|
prettyPrint(event)
|
||||||
} else {
|
} else {
|
||||||
h.Logger.Debug("Received event contains config change info")
|
h.Logger.Debug("Received event contains config change info")
|
||||||
configChanges = h.processConfigChanges(event.CloudEvent.Data.ConfigChanges.Modified)
|
configChanges = h.processConfigChanges(event.CloudEvent.Data.ConfigChanges.Modified)
|
||||||
@@ -81,14 +82,11 @@ func (h *Handler) VmModify(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
h.Logger.Debug("created database record", "insert_result", result)
|
h.Logger.Debug("created database record", "insert_result", result)
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
fmt.Fprintf(w, "Update Request (%d): %v\n", len(reqBody), string(reqBody))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h.Logger.Debug("received update request", "body", string(reqBody))
|
|
||||||
w.WriteHeader(http.StatusOK)
|
|
||||||
fmt.Fprintf(w, "Update Request (%d): %v\n", len(reqBody), string(reqBody))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) processConfigChanges(configChanges string) []map[string]string {
|
func (h *Handler) processConfigChanges(configChanges string) []map[string]string {
|
||||||
|
Reference in New Issue
Block a user