mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
cloud: ovirt: Fix searching of network in datacenter (#25248)
This commit is contained in:
parent
cbe87d0af7
commit
bcc5bffd8e
1 changed files with 6 additions and 8 deletions
|
@ -229,14 +229,12 @@ def main():
|
|||
service=networks_service,
|
||||
)
|
||||
state = module.params['state']
|
||||
network = networks_module.search_entity(
|
||||
search_params={
|
||||
'name': module.params['name'],
|
||||
'datacenter': module.params['data_center'],
|
||||
},
|
||||
)
|
||||
search_params = {
|
||||
'name': module.params['name'],
|
||||
'datacenter': module.params['data_center'],
|
||||
}
|
||||
if state == 'present':
|
||||
ret = networks_module.create(entity=network)
|
||||
ret = networks_module.create(search_params=search_params)
|
||||
|
||||
# Update clusters networks:
|
||||
if module.params.get('clusters') is not None:
|
||||
|
@ -258,7 +256,7 @@ def main():
|
|||
ret = cluster_networks_module.remove()
|
||||
|
||||
elif state == 'absent':
|
||||
ret = networks_module.remove(entity=network)
|
||||
ret = networks_module.remove(search_params=search_params)
|
||||
|
||||
module.exit_json(**ret)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Reference in a new issue