Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ADO committed May 24, 2017
1 parent 491bce5 commit 9794d33
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions vsphere-influxdb.go
Expand Up @@ -244,8 +244,8 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.
// Add found object to object list
mors = append(mors, containerView.View...)
}
// Create MORS for each object type

// Create MORS for each object type
vmRefs := []types.ManagedObjectReference{}
hostRefs := []types.ManagedObjectReference{}
clusterRefs := []types.ManagedObjectReference{}
Expand Down Expand Up @@ -606,9 +606,10 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.
var respool []mo.ResourcePool
err = pc.Retrieve(ctx, respool_refs, []string{"name", "config", "vm"}, &respool)
if err != nil {
fmt.Println(err)
return
errlog.Println(err)
continue
}

for _, pool := range respool {
respoolFields := map[string]interface{}{
"cpu_limit": pool.Config.CpuAllocation.GetResourceAllocationInfo().Limit,
Expand All @@ -618,6 +619,7 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.
pt3, err := influxclient.NewPoint("resourcepool", respoolTags, respoolFields, time.Now())
if err != nil {
errlog.Println(err)
continue
}
bp.AddPoint(pt3)
}
Expand Down Expand Up @@ -695,8 +697,7 @@ func queryVCenter(vcenter VCenter, config Configuration, InfluxDBClient influxcl
}

func main() {

flag.BoolVar(&debug, "debug", true, "Debug mode")
flag.BoolVar(&debug, "debug", false, "Debug mode")
var cfgFile = flag.String("config", "/etc/"+path.Base(os.Args[0])+".json", "Config file to use. Default is /etc/"+path.Base(os.Args[0])+".json")
flag.Parse()

Expand Down

0 comments on commit 9794d33

Please sign in to comment.