vmware_vm_facts: fix the support with regular ESXi

Ensure the module still work with the ESXi where CustomFieldsManager
does not exist.

From: https://www.vmware.com/support/developer/converter-sdk/conv60_apireference/vim.CustomFieldsManager.html

    The CustomFieldsManager object is used to add and remove custom fields to
    managed entities.
    The custom fields values set on managed entities are available through the
    customValue property and through the summary objects for VirtualMachine
    and HostSystem. They are not available directly through this managed object.
    This functionality is only available through VirtualCenter.

Fixes: #56071
This commit is contained in:
Gonéri Le Bouder 2019-05-03 18:08:42 -04:00
parent 21d4e239b4
commit cf78759f5b
7 changed files with 33 additions and 18 deletions

View file

@ -89,7 +89,9 @@ class FakeAnsibleModule:
def fake_connect_to_api(module):
pass
class MyContent():
customFieldsManager = None
return MyContent
def test_pyvmomi_lib_exists(mocker, fake_ansible_module):