Correct mute function in datadog_monitor (#19662)

pull/28530/head
Karol Chrapek 7 years ago committed by Chris Alfonso
parent 4a2b4d07db
commit 0954fadff7

@ -329,7 +329,7 @@ def mute_monitor(module):
module.fail_json(msg="Monitor %s not found!" % module.params['name']) module.fail_json(msg="Monitor %s not found!" % module.params['name'])
elif monitor['options']['silenced']: elif monitor['options']['silenced']:
module.fail_json(msg="Monitor is already muted. Datadog does not allow to modify muted alerts, consider unmuting it first.") module.fail_json(msg="Monitor is already muted. Datadog does not allow to modify muted alerts, consider unmuting it first.")
elif (module.params['silenced'] is not None and len(set(monitor['options']['silenced']) - set(module.params['silenced'])) == 0): elif (module.params['silenced'] is not None and len(set(monitor['options']['silenced']) ^ set(module.params['silenced'])) == 0):
module.exit_json(changed=False) module.exit_json(changed=False)
try: try:
if module.params['silenced'] is None or module.params['silenced'] == "": if module.params['silenced'] is None or module.params['silenced'] == "":

Loading…
Cancel
Save