change srm match
This commit is contained in:
@@ -455,7 +455,7 @@ func (v *Vcenter) FindVMByIDWithDatacenter(vmID string, dcID string) (*mo.Virtua
|
||||
} else if _, ok := err.(*find.NotFoundError); !ok {
|
||||
// If the error is not a NotFoundError, return it
|
||||
//return nil, fmt.Errorf("failed to retrieve VM with ID %s in datacenter %s: %w", vmID, dc.Name(), err)
|
||||
v.Logger.Debug("Couldn't find vm in datacenter", "vm_id", vmID, "datacenter_id", dcID)
|
||||
//v.Logger.Debug("Couldn't find vm in datacenter", "vm_id", vmID, "datacenter_id", dcID)
|
||||
return nil, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("failed to retrieve VM: %w", err)
|
||||
@@ -493,7 +493,7 @@ func (v *Vcenter) GetVMFolderPath(vm mo.VirtualMachine) (string, error) {
|
||||
|
||||
// Traverse the folder hierarchy to build the full folder path
|
||||
folderPath := ""
|
||||
v.Logger.Debug("parent is", "parent", parentRef)
|
||||
//v.Logger.Debug("parent is", "parent", parentRef)
|
||||
|
||||
for parentRef.Type != "Datacenter" {
|
||||
// Retrieve the parent object
|
||||
@@ -518,7 +518,7 @@ func (v *Vcenter) GetVMFolderPath(vm mo.VirtualMachine) (string, error) {
|
||||
//if folder, ok := parentObj.(*object.Folder); ok {
|
||||
if parentObj.Parent != nil {
|
||||
parentRef = parentObj.Parent
|
||||
v.Logger.Debug("Parent uplevel is", "ref", parentRef)
|
||||
//v.Logger.Debug("Parent uplevel is", "ref", parentRef)
|
||||
} else {
|
||||
return "", fmt.Errorf("unexpected parent type: %s", parentObj.Reference().Type)
|
||||
}
|
||||
|
@@ -140,7 +140,7 @@ func (h *Handler) VmModifyEvent(w http.ResponseWriter, r *http.Request) {
|
||||
params.PlaceholderChange = sql.NullString{String: "testVm", Valid: true}
|
||||
changeFound = true
|
||||
params.UpdateType = "srm"
|
||||
} else if change["newValue"] == "placeholderVm" {
|
||||
} else if change["newValue"] == "\\\"placeholderVm\\\"" {
|
||||
h.Logger.Debug("placeholderVm")
|
||||
params.PlaceholderChange = sql.NullString{String: "placeholderVm", Valid: true}
|
||||
changeFound = true
|
||||
|
Reference in New Issue
Block a user