From bac2e02900100b28e5d45826f0826ebc44e80aa0 Mon Sep 17 00:00:00 2001 From: njferrant <40184954+njferrant@users.noreply.github.com> Date: Mon, 6 Jan 2020 16:41:02 -0500 Subject: [PATCH] vmware_guest: exclude dvswitch_name from guest os customization (#65997) - exclude dvswitch_name from guest os customization - add changelog fragment for ansible PR#65997 --- ...ware_guest-exclude-dvswitch-name-from-os-customization.yml | 2 ++ lib/ansible/modules/cloud/vmware/vmware_guest.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/65997-vmware_guest-exclude-dvswitch-name-from-os-customization.yml diff --git a/changelogs/fragments/65997-vmware_guest-exclude-dvswitch-name-from-os-customization.yml b/changelogs/fragments/65997-vmware_guest-exclude-dvswitch-name-from-os-customization.yml new file mode 100644 index 00000000000..f1260d20ae9 --- /dev/null +++ b/changelogs/fragments/65997-vmware_guest-exclude-dvswitch-name-from-os-customization.yml @@ -0,0 +1,2 @@ +bugfixes: + - vmware_guest - Exclude dvswitch_name from triggering guest os customization. diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest.py b/lib/ansible/modules/cloud/vmware/vmware_guest.py index d4c2cb0abf4..5f2d0d82ef4 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest.py @@ -2432,7 +2432,7 @@ class PyVmomiHelper(PyVmomi): if key == 'type' and nw['type'] == 'dhcp': network_changes = True break - if key not in ('device_type', 'mac', 'name', 'vlan', 'type', 'start_connected'): + if key not in ('device_type', 'mac', 'name', 'vlan', 'type', 'start_connected', 'dvswitch_name'): network_changes = True break @@ -2701,7 +2701,7 @@ class PyVmomiHelper(PyVmomi): for nw in self.params['networks']: for key in nw: # We don't need customizations for these keys - if key not in ('device_type', 'mac', 'name', 'vlan', 'type', 'start_connected'): + if key not in ('device_type', 'mac', 'name', 'vlan', 'type', 'start_connected', 'dvswitch_name'): network_changes = True break if len(self.params['customization']) > 1 or network_changes or self.params.get('customization_spec'):