cloud: ovirt: Add support to list nested entities parameters (#19300)

pull/19343/head
Ondra Machacek 8 years ago committed by Ryan Brown
parent 59227d8c31
commit fa96438f4c

@ -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):

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

@ -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
],
),
)

Loading…
Cancel
Save