Adjust conditional for disabling alert email (#63951)

* Adjust conditional for disabling alert email

Conditional was improperly disabling existing alert email when it was found enabled.  The expectation is that it should only disable if module.param['enabled'] was set to false.

* Adjusted disable logic

Added back in the logic of only disabling the alert email if it is module.params['enabled'] is false AND current value of enabled is true on the array
pull/64785/merge
Thomas Reppert 5 years ago committed by ansibot
parent 5c0b2c151c
commit fbdd295cef

@ -160,7 +160,7 @@ def main():
create_alert(module, array)
elif module.params['state'] == 'present' and exists and not enabled and module.params['enabled']:
enable_alert(module, array)
elif module.params['state'] == 'present' and exists and enabled:
elif module.params['state'] == 'present' and exists and enabled and not module.params['enabled']:
disable_alert(module, array)
elif module.params['state'] == 'absent' and exists:
delete_alert(module, array)

Loading…
Cancel
Save