change logging
Some checks are pending
CI / Lint (push) Waiting to run
CI / Test (push) Waiting to run
CI / End-to-End (push) Waiting to run
CI / Publish Docker (push) Blocked by required conditions
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-13 11:41:06 +10:00
parent 5affdb8eb1
commit 446cd30d8e

View File

@@ -73,9 +73,9 @@ func (h *Handler) VmCreate(w http.ResponseWriter, r *http.Request) {
h.Logger.Debug("didn't find VM", "vm_id", vm.CloudEvent.Data.VM.VM.Value)
numRam = 0
numVcpus = 0
datacenter = ""
datacenter = vm.CloudEvent.Data.Datacenter.Name
} else {
h.Logger.Debug("found VM", "object", vmObject)
h.Logger.Debug("found VM")
//prettyPrint(vmObject)
// calculate VM properties we want to store
@@ -101,6 +101,7 @@ func (h *Handler) VmCreate(w http.ResponseWriter, r *http.Request) {
EventKey: sql.NullString{String: strconv.Itoa(vm.CloudEvent.Data.Key), Valid: strconv.Itoa(vm.CloudEvent.Data.Key) != ""},
VmId: sql.NullString{String: vm.CloudEvent.Data.VM.VM.Value, Valid: vm.CloudEvent.Data.VM.VM.Value != ""},
Datacenter: sql.NullString{String: datacenter, Valid: datacenter != ""},
Cluster: sql.NullString{String: vm.CloudEvent.Data.ComputeResource.Name, Valid: vm.CloudEvent.Data.ComputeResource.Name != ""},
CreationTime: sql.NullInt64{Int64: unixTimestamp, Valid: unixTimestamp > 0},
InitialVcpus: sql.NullInt64{Int64: int64(numVcpus), Valid: numVcpus > 0},
InitialRam: sql.NullInt64{Int64: int64(numRam), Valid: numRam > 0},