mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-14 13:09:11 -07:00
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:
parent
21d4e239b4
commit
cf78759f5b
7 changed files with 33 additions and 18 deletions
|
@ -139,7 +139,6 @@ from ansible.module_utils.vmware import PyVmomi, vmware_argument_spec
|
|||
class VmAttributeManager(PyVmomi):
|
||||
def __init__(self, module):
|
||||
super(VmAttributeManager, self).__init__(module)
|
||||
self.custom_field_mgr = self.content.customFieldsManager.field
|
||||
|
||||
def set_custom_field(self, vm, user_fields):
|
||||
result_fields = dict()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue