VMware: Handle NoneType in vmware_vmkernel_info (#65834)
Check for virtualNicManager in Esxi host system before accessing properties in vmware_vmkernel_info. Fixes: #62772 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
365820f871
commit
34acabd70a
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/62772-vmware_vmkernel_info-fix.yml
Normal file
2
changelogs/fragments/62772-vmware_vmkernel_info-fix.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- Check for virtualNicManager in Esxi host system before accessing properties in vmware_vmkernel_info (https://github.com/ansible/ansible/issues/62772).
|
|
@ -145,7 +145,7 @@ class VmkernelInfoManager(PyVmomi):
|
|||
self.module.fail_json(msg="Failed to get all VMKs for service type %s due to"
|
||||
"%s" % (service_type, to_native(e)))
|
||||
|
||||
if not query.selectedVnic:
|
||||
if not query or not query.selectedVnic:
|
||||
return vmks_list
|
||||
selected_vnics = [vnic for vnic in query.selectedVnic]
|
||||
vnics_with_service_type = [vnic.device for vnic in query.candidateVnic if vnic.key in selected_vnics]
|
||||
|
|
Loading…
Reference in a new issue