os_security_group_rule proper module exit (#50076)

When the security group the rule belongs to does not exist and
the state is absent, the module is not properly exited, leading
to a playbook execution failure.

Fixes issue #50057
pull/50191/head
Miguel Duarte Barroso 6 years ago committed by John R Barker
parent bcae7f24cb
commit 4951e5a5b7

@ -0,0 +1,4 @@
bugfixes:
- os_security_group_rule - os_security_group_rule doesn't exit properly when
secgroup doesn't exist and state=absent
(https://github.com/ansible/ansible/issues/50057)

@ -359,7 +359,7 @@ def main():
cloud.delete_security_group_rule(rule['id'])
changed = True
module.exit_json(changed=changed)
module.exit_json(changed=changed)
except sdk.exceptions.OpenStackCloudException as e:
module.fail_json(msg=str(e))

Loading…
Cancel
Save