From d55e3ad0b81f641ea891fa283f365a92b6e93143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Thu, 11 Apr 2019 10:24:55 -0400 Subject: [PATCH] vmware_host_vmnic_facts: ensure nm_config is define (#55156) Fix a regression introduced by f96c569f9d1568f634645e7d3d04b566812039ee. --- lib/ansible/modules/cloud/vmware/vmware_host_vmnic_facts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_host_vmnic_facts.py b/lib/ansible/modules/cloud/vmware/vmware_host_vmnic_facts.py index a867d5b4237..32bf5584e50 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_host_vmnic_facts.py +++ b/lib/ansible/modules/cloud/vmware/vmware_host_vmnic_facts.py @@ -192,8 +192,8 @@ class HostVmnicMgr(PyVmomi): host_vmnic_facts = dict(all=[], available=[], used=[], vswitch=dict(), dvswitch=dict()) host_nw_system = host.configManager.networkSystem if host_nw_system: - vmnics = [pnic.device for pnic in nw_config.pnic if pnic.startswith('vmnic')] nw_config = host_nw_system.networkConfig + vmnics = [pnic.device for pnic in nw_config.pnic if pnic.device.startswith('vmnic')] host_vmnic_facts['all'] = [pnic.device for pnic in nw_config.pnic] host_vmnic_facts['num_vmnics'] = len(vmnics) host_vmnic_facts['vmnic_details'] = []