diff --git a/lib/ansible/module_utils/ovirt.py b/lib/ansible/module_utils/ovirt.py index 96edc68d384..7449c64d421 100644 --- a/lib/ansible/module_utils/ovirt.py +++ b/lib/ansible/module_utils/ovirt.py @@ -460,7 +460,12 @@ class BaseModule(object): return { 'changed': self.changed, 'id': entity.id, - type(entity).__name__.lower(): get_dict_of_struct(entity), + type(entity).__name__.lower(): get_dict_of_struct( + struct=entity, + connection=self._connection, + fetch_nested=self._module.params.get('fetch_nested'), + attributes=self._module.params.get('nested_attributes'), + ), } def pre_remove(self, entity): @@ -512,7 +517,12 @@ class BaseModule(object): return { 'changed': self.changed, 'id': entity.id, - type(entity).__name__.lower(): get_dict_of_struct(entity), + type(entity).__name__.lower(): get_dict_of_struct( + struct=entity, + connection=self._connection, + fetch_nested=self._module.params.get('fetch_nested'), + attributes=self._module.params.get('nested_attributes'), + ), } def action( @@ -582,7 +592,12 @@ class BaseModule(object): return { 'changed': self.changed, 'id': entity.id, - type(entity).__name__.lower(): get_dict_of_struct(entity), + type(entity).__name__.lower(): get_dict_of_struct( + struct=entity, + connection=self._connection, + fetch_nested=self._module.params.get('fetch_nested'), + attributes=self._module.params.get('nested_attributes'), + ), } def search_entity(self, search_params=None): diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_affinity_labels_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_affinity_labels_facts.py index e3a49b590b5..37f7d522ce7 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_affinity_labels_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_affinity_labels_facts.py @@ -144,7 +144,12 @@ def main(): changed=False, ansible_facts=dict( affinity_labels=[ - get_dict_of_struct(l) for l in labels + get_dict_of_struct( + struct=l, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for l in labels ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_clusters_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_clusters_facts.py index 32fac5ab537..a017d9f6634 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_clusters_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_clusters_facts.py @@ -89,7 +89,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_clusters=[ - get_dict_of_struct(c) for c in clusters + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in clusters ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_datacenters_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_datacenters_facts.py index 7340c50cbad..d7af9aa0f9d 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_datacenters_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_datacenters_facts.py @@ -88,7 +88,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_datacenters=[ - get_dict_of_struct(c) for c in datacenters + get_dict_of_struct( + struct=d, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for d in datacenters ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_external_providers_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_external_providers_facts.py index 0eee5e86151..87c0defda8f 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_external_providers_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_external_providers_facts.py @@ -137,7 +137,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_external_providers=[ - get_dict_of_struct(c) for c in external_providers + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in external_providers ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_groups_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_groups_facts.py index b327f1ca2b2..e99598a1fff 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_groups_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_groups_facts.py @@ -88,7 +88,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_groups=[ - get_dict_of_struct(c) for c in groups + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in groups ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_hosts_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_hosts_facts.py index ad1945e538c..147822675b1 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_hosts_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_hosts_facts.py @@ -87,7 +87,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_hosts=[ - get_dict_of_struct(c) for c in hosts + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in hosts ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_networks_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_networks_facts.py index aed8cd423e6..eb353300547 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_networks_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_networks_facts.py @@ -90,7 +90,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_networks=[ - get_dict_of_struct(c) for c in networks + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in networks ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_nics_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_nics_facts.py index abdc9cd12c3..6c25398c4f2 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_nics_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_nics_facts.py @@ -108,7 +108,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_nics=[ - get_dict_of_struct(c) for c in nics + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in nics ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_quotas_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_quotas_facts.py index 5c72259c427..abba0f581bb 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_quotas_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_quotas_facts.py @@ -107,7 +107,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_quotas=[ - get_dict_of_struct(c) for c in quotas + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in quotas ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains_facts.py index ba66be954d0..211b34c04a1 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_storage_domains_facts.py @@ -90,7 +90,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_storage_domains=[ - get_dict_of_struct(c) for c in storage_domains + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in storage_domains ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_templates_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_templates_facts.py index afd34038d01..06d7997fe58 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_templates_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_templates_facts.py @@ -90,7 +90,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_templates=[ - get_dict_of_struct(c) for c in templates + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in templates ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_users_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_users_facts.py index a51f8c0b2ec..846fe4827b1 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_users_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_users_facts.py @@ -88,7 +88,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_users=[ - get_dict_of_struct(c) for c in users + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in users ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py index 7a7c19a98ec..345975ce26c 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vmpools_facts.py @@ -88,7 +88,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_vm_pools=[ - get_dict_of_struct(c) for c in vmpools + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in vmpools ], ), ) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vms_facts.py b/lib/ansible/modules/cloud/ovirt/ovirt_vms_facts.py index 519b06995f5..df3defaa672 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vms_facts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vms_facts.py @@ -90,7 +90,12 @@ def main(): changed=False, ansible_facts=dict( ovirt_vms=[ - get_dict_of_struct(c) for c in vms + get_dict_of_struct( + struct=c, + connection=connection, + fetch_nested=module.params.get('fetch_nested'), + attributes=module.params.get('nested_attributes'), + ) for c in vms ], ), )