mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
VMware: Check device type explicitly (#38729)
Check datatype of device instead of comparing them directly in vmware_guest. Also, added testcases to check this behavior. DPVG is not supported in current version vcsim Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
5cf61d7401
commit
79c7d462c1
3 changed files with 100 additions and 1 deletions
|
@ -1100,7 +1100,8 @@ class PyVmomiHelper(PyVmomi):
|
|||
nic_change_detected = True
|
||||
if 'device_type' in network_devices[key]:
|
||||
device = self.device_helper.get_device(network_devices[key]['device_type'], network_name)
|
||||
if nic.device != device:
|
||||
device_class = type(device)
|
||||
if not isinstance(nic.device, device_class):
|
||||
self.module.fail_json(msg="Changing the device type is not possible when interface is already present. "
|
||||
"The failing device type is %s" % network_devices[key]['device_type'])
|
||||
# Changing mac address has no effect when editing interface
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue