This commit is contained in:
12
main.go
12
main.go
@@ -139,7 +139,7 @@ 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
|
// Determine cluster based on runtime host of VM based on https://github.com/vmware/govmomi/issues/1242#issuecomment-427671990
|
||||||
for _, host := range hsList {
|
for _, host := range hsList {
|
||||||
if host.Reference() == *vm.Summary.Runtime.Host {
|
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
|
var cluster mo.ManagedEntity
|
||||||
err = pc.RetrieveOne(ctx, *host.Parent, []string{"name"}, &cluster)
|
err = pc.RetrieveOne(ctx, *host.Parent, []string{"name"}, &cluster)
|
||||||
@@ -215,6 +215,7 @@ func generateBusSharingTable() string {
|
|||||||
|
|
||||||
// Convert the buffer to a string
|
// Convert the buffer to a string
|
||||||
htmlString := buf.String()
|
htmlString := buf.String()
|
||||||
|
fmt.Printf("generateBusSharingTable : %s\n", htmlString)
|
||||||
|
|
||||||
return htmlString
|
return htmlString
|
||||||
|
|
||||||
@@ -249,8 +250,9 @@ func updateHtml(htmlContent string, heading string, newTable string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// goquery produces implicit nodes when parsing the input html, remove them now
|
// goquery produces implicit nodes when parsing the input html, remove them now
|
||||||
h = strings.Replace("<html><head></head><body>", h, "", 1)
|
fmt.Printf("updateHtml whole doc : %s\n", h)
|
||||||
h = strings.Replace("</body></html>", h, "", 1)
|
h = strings.Replace(h, "<html><head></head><body>", "", 1)
|
||||||
|
h = strings.Replace(h, "</body></html>", "", 1)
|
||||||
|
|
||||||
return h
|
return h
|
||||||
}
|
}
|
||||||
@@ -281,10 +283,10 @@ func main() {
|
|||||||
defer f.Close()
|
defer f.Close()
|
||||||
log.SetOutput(f)
|
log.SetOutput(f)
|
||||||
|
|
||||||
log.Printf("Starting execution. Built on %s from sha1 %s\n", buildTime, sha1ver)
|
fmt.Printf("Starting execution. Built on %s from sha1 %s\n", buildTime, sha1ver)
|
||||||
|
|
||||||
// So we can convert vCenter UTC to our local timezone
|
// So we can convert vCenter UTC to our local timezone
|
||||||
log.Printf("Setting timezone to '%s'\n", *vTZ)
|
fmt.Printf("Setting timezone to '%s'\n", *vTZ)
|
||||||
location, err = time.LoadLocation(*vTZ)
|
location, err = time.LoadLocation(*vTZ)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error setting timezone to %s : %s\n", *vTZ, err)
|
fmt.Fprintf(os.Stderr, "Error setting timezone to %s : %s\n", *vTZ, err)
|
||||||
|
Reference in New Issue
Block a user