From ac62e71236debb2158e83d93345867c941b9598e Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Thu, 26 Oct 2023 16:41:53 +1100 Subject: [PATCH] more debugging --- main.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 460ca1d..13e212e 100644 --- a/main.go +++ b/main.go @@ -123,7 +123,7 @@ func getScsiBusSharingVMs(client *govmomi.Client) error { // Iterate through VMs and check for SCSI bus sharing for _, vm := range vmList { - //fmt.Printf("vm : %s [%s]\n", vm.Name, vm.Summary.Runtime.Host) + fmt.Printf("vm : %s [%s]\n", vm.Name, vm.Summary.Runtime.Host) //fmt.Printf("vm parent: %v\n", vm.Parent) /* @@ -141,12 +141,13 @@ func getScsiBusSharingVMs(client *govmomi.Client) error { // Determine cluster based on runtime host of VM based on https://github.com/vmware/govmomi/issues/1242#issuecomment-427671990 for _, host := range hsList { if host.Reference() == *vm.Summary.Runtime.Host { - //fmt.Printf("host %s matches with parent %s\n", host.Name, host.Parent) + fmt.Printf("host %s matches with parent %s\n", host.Name, host.Parent) var cluster mo.ManagedEntity err = pc.RetrieveOne(ctx, *host.Parent, []string{"name"}, &cluster) if err != nil { - log.Fatal(err) + log.Printf("Error retrieving cluster object : '%s'\n", err) + return err } //fmt.Println(cluster.Name) clusterName = cluster.Name @@ -158,7 +159,7 @@ func getScsiBusSharingVMs(client *govmomi.Client) error { for _, device := range vm.Config.Hardware.Device { //fmt.Printf("device: %v\n", device) if scsi, ok := device.(types.BaseVirtualSCSIController); ok { - //fmt.Printf("scsi: %v\n", scsi) + fmt.Printf("scsi: %v\n", scsi) controller := scsi.GetVirtualSCSIController() //fmt.Printf("controller: %s\n", device.GetVirtualDevice().DeviceInfo.GetDescription().Label) fmt.Printf("VM %s is using SCSI bus sharing mode: %s\n", vm.Name, string(controller.SharedBus)) @@ -235,7 +236,7 @@ func updateHtml(htmlContent string, heading string, newTable string) string { } // goquery produces implicit nodes when parsing the input html, remove them now - fmt.Printf("updateHtml whole doc : %s\n", h) + //fmt.Printf("updateHtml whole doc : %s\n", h) h = strings.Replace(h, "", "", -1) h = strings.Replace(h, "", "", -1)