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:
Lemar Carthens
2017-05-16 11:47:49 -04:00
committed by jctanner
parent e5cd675b38
commit ef13f0f389
2 changed files with 11 additions and 3 deletions

View File

@@ -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