Skip to content

Commit

Permalink
Code simplification in endpoint.go for memorySizeMB declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
6monlambert authored and DStrand1 committed Aug 13, 2024
1 parent db52f36 commit b1c28ab
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions plugins/inputs/vsphere/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,6 @@ func getVMs(ctx context.Context, e *Endpoint, resourceFilter *ResourceFilter) (o
}
guest := "unknown"
uuid := ""
var memorySizeMB int32
lookup := make(map[string]string)
// Get the name of the VM resource pool
rpname := getResourcePoolName(*r.ResourcePool, resourcePools)
Expand Down Expand Up @@ -847,9 +846,6 @@ func getVMs(ctx context.Context, e *Endpoint, resourceFilter *ResourceFilter) (o
}
uuid = r.Config.Uuid
}
if r.Summary.Config.MemorySizeMB != 0 {
memorySizeMB = r.Summary.Config.MemorySizeMB
}

cvs := make(map[string]string)
if e.customAttrEnabled {
Expand All @@ -873,7 +869,7 @@ func getVMs(ctx context.Context, e *Endpoint, resourceFilter *ResourceFilter) (o
ref: r.ExtensibleManagedObject.Reference(),
parentRef: r.Runtime.Host,
guest: guest,
memorySizeMB: memorySizeMB,
memorySizeMB: r.Summary.Config.MemorySizeMB,
altID: uuid,
rpname: rpname,
customValues: e.loadCustomAttributes(r.ManagedEntity),
Expand Down

0 comments on commit b1c28ab

Please sign in to comment.