mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00: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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user