mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
vmware_guest: Fix VM creation when adding a network device without a MAC address (#24138)
* vmware_guest: Fix VM creation when adding a network device without a MAC address * Provide python2.4 compatibility
This commit is contained in:
parent
e5cd675b38
commit
ef13f0f389
2 changed files with 11 additions and 3 deletions
|
@ -399,7 +399,6 @@ class PyVmomiDeviceHelper(object):
|
|||
(device_type, device_infos['name']))
|
||||
|
||||
nic.device.wakeOnLanEnabled = True
|
||||
nic.device.addressType = 'assigned'
|
||||
nic.device.deviceInfo = vim.Description()
|
||||
nic.device.deviceInfo.label = device_label
|
||||
nic.device.deviceInfo.summary = device_infos['name']
|
||||
|
@ -408,7 +407,10 @@ class PyVmomiDeviceHelper(object):
|
|||
nic.device.connectable.allowGuestControl = True
|
||||
nic.device.connectable.connected = True
|
||||
if 'mac' in device_infos:
|
||||
nic.device.addressType = 'assigned'
|
||||
nic.device.macAddress = device_infos['mac']
|
||||
else:
|
||||
nic.device.addressType = 'generated'
|
||||
|
||||
return nic
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue