mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
make os_network correctly report changed status
The `os_network` module was incorrectly returning changed=False whether or not the network was created. This commit makes the changed return value useful.
This commit is contained in:
parent
70bd95b4f0
commit
c1e081fcf6
1 changed files with 4 additions and 1 deletions
|
@ -146,7 +146,10 @@ def main():
|
||||||
if state == 'present':
|
if state == 'present':
|
||||||
if not net:
|
if not net:
|
||||||
net = cloud.create_network(name, shared, admin_state_up, external)
|
net = cloud.create_network(name, shared, admin_state_up, external)
|
||||||
module.exit_json(changed=False, network=net, id=net['id'])
|
changed = True
|
||||||
|
else:
|
||||||
|
changed = False
|
||||||
|
module.exit_json(changed=changed, network=net, id=net['id'])
|
||||||
|
|
||||||
elif state == 'absent':
|
elif state == 'absent':
|
||||||
if not net:
|
if not net:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue