more debugging
This commit is contained in:
@@ -82,6 +82,7 @@ func (v *Vcenter) Login(vUrl string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *Vcenter) Logout() error {
|
func (v *Vcenter) Logout() error {
|
||||||
|
v.Logger.Debug("vcenter logging out")
|
||||||
return v.client.Logout(v.ctx)
|
return v.client.Logout(v.ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,5 +204,6 @@ func (v *Vcenter) FindVMByIDWithDatacenter(vmID string, dcID string) (*VmPropert
|
|||||||
return nil, fmt.Errorf("failed to retrieve VM: %w", err)
|
return nil, fmt.Errorf("failed to retrieve VM: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, fmt.Errorf("VM with ID %s not found in any datacenter", vmID)
|
v.Logger.Info("Unable to find vm in datacenter", "vm_id", vmID, "datacenter_id", dcID)
|
||||||
|
return &VmProperties{}, nil
|
||||||
}
|
}
|
||||||
|
@@ -88,6 +88,7 @@ func (h *Handler) VmCreate(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create an instance of CreateInventoryParams
|
// Create an instance of CreateInventoryParams
|
||||||
|
h.Logger.Debug("Creating database parameters")
|
||||||
params := queries.CreateInventoryParams{
|
params := queries.CreateInventoryParams{
|
||||||
Name: vm.CloudEvent.Data.VM.Name,
|
Name: vm.CloudEvent.Data.VM.Name,
|
||||||
Vcenter: vm.CloudEvent.Source,
|
Vcenter: vm.CloudEvent.Source,
|
||||||
|
Reference in New Issue
Block a user