mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-07-02 03:22:59 +00:00
Changed mac_addresses attribute logic
This commit is contained in:
parent
d29a0a7ef6
commit
b52c6fb082
@ -428,7 +428,7 @@ This resource doesn't expose any additional attributes.
|
||||
###### Attributes
|
||||
* `ipv4_addresses` - The IPv4 addresses per network interface published by the QEMU agent (empty list when `agent.enabled` is `false`)
|
||||
* `ipv6_addresses` - The IPv6 addresses per network interface published by the QEMU agent (empty list when `agent.enabled` is `false`)
|
||||
* `mac_addresses` - The MAC addresses assigned to the network devices
|
||||
* `mac_addresses` - The MAC addresses published by the QEMU agent with fallback to the VM configuration, if the agent is disabled
|
||||
* `network_interface_names` - The network interface names published by the QEMU agent (empty list when `agent.enabled` is `false`)
|
||||
|
||||
## Developing the Provider
|
||||
|
@ -1554,6 +1554,7 @@ func resourceVirtualEnvironmentVMRead(d *schema.ResourceData, m interface{}) err
|
||||
if err == nil && networkInterfaces.Result != nil {
|
||||
ipv4Addresses = make([]interface{}, len(*networkInterfaces.Result))
|
||||
ipv6Addresses = make([]interface{}, len(*networkInterfaces.Result))
|
||||
macAddresses = make([]interface{}, len(*networkInterfaces.Result))
|
||||
networkInterfaceNames = make([]interface{}, len(*networkInterfaces.Result))
|
||||
|
||||
for ri, rv := range *networkInterfaces.Result {
|
||||
@ -1571,6 +1572,7 @@ func resourceVirtualEnvironmentVMRead(d *schema.ResourceData, m interface{}) err
|
||||
|
||||
ipv4Addresses[ri] = rvIPv4Addresses
|
||||
ipv6Addresses[ri] = rvIPv6Addresses
|
||||
macAddresses[ri] = strings.ToUpper(rv.MACAddress)
|
||||
networkInterfaceNames[ri] = rv.Name
|
||||
}
|
||||
}
|
||||
@ -1578,6 +1580,7 @@ func resourceVirtualEnvironmentVMRead(d *schema.ResourceData, m interface{}) err
|
||||
|
||||
d.Set(mkResourceVirtualEnvironmentVMIPv4Addresses, ipv4Addresses)
|
||||
d.Set(mkResourceVirtualEnvironmentVMIPv6Addresses, ipv6Addresses)
|
||||
d.Set(mkResourceVirtualEnvironmentVMMACAddresses, macAddresses)
|
||||
d.Set(mkResourceVirtualEnvironmentVMNetworkInterfaceNames, networkInterfaceNames)
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user