mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
vSphere Provider: If we only have one networkInterface, deviceID should (#8276)
be 0 to ensure that it selects the first element of the networkInterfaces array.
This commit is contained in:
parent
0cfda8fb17
commit
ceccdb827a
@ -1059,6 +1059,9 @@ func resourceVSphereVirtualMachineRead(d *schema.ResourceData, meta interface{})
|
||||
}
|
||||
if gatewaySetting != "" {
|
||||
deviceID, err := strconv.Atoi(route.Gateway.Device)
|
||||
if len(networkInterfaces) == 1 {
|
||||
deviceID = 0
|
||||
}
|
||||
if err != nil {
|
||||
log.Printf("[WARN] error at processing %s of device id %#v: %#v", gatewaySetting, route.Gateway.Device, err)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user