diff --git a/lib/ansible/module_utils/ovirt.py b/lib/ansible/module_utils/ovirt.py index 96edc68d38..7449c64d42 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 e3a49b590b..37f7d522ce 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 32fac5ab53..a017d9f663 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 7340c50cba..d7af9aa0f9 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 0eee5e8615..87c0defda8 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 b327f1ca2b..e99598a1ff 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 ad1945e538..147822675b 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 aed8cd423e..eb35330054 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 abdc9cd12c..6c25398c4f 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 5c72259c42..abba0f581b 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 ba66be954d..211b34c04a 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 afd34038d0..06d7997fe5 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 a51f8c0b2e..846fe4827b 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 7a7c19a98e..345975ce26 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 519b06995f..df3defaa67 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 ], ), )