mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
datadog_monitor: fix template vars in 'name' and 'escalation_message' (#38483)
This commit is contained in:
parent
5fdf0290d0
commit
02bfb9047c
1 changed files with 7 additions and 3 deletions
|
@ -221,7 +221,7 @@ def _get_monitor(module):
|
|||
else:
|
||||
monitors = api.Monitor.get_all()
|
||||
for monitor in monitors:
|
||||
if monitor['name'] == module.params['name']:
|
||||
if monitor['name'] == _fix_template_vars(module.params['name']):
|
||||
return monitor
|
||||
return {}
|
||||
|
||||
|
@ -229,7 +229,9 @@ def _get_monitor(module):
|
|||
def _post_monitor(module, options):
|
||||
try:
|
||||
kwargs = dict(type=module.params['type'], query=module.params['query'],
|
||||
name=module.params['name'], message=_fix_template_vars(module.params['message']),
|
||||
name=_fix_template_vars(module.params['name']),
|
||||
message=_fix_template_vars(module.params['message']),
|
||||
escalation_message=_fix_template_vars(module.params['escalation_message']),
|
||||
options=options)
|
||||
if module.params['tags'] is not None:
|
||||
kwargs['tags'] = module.params['tags']
|
||||
|
@ -251,7 +253,9 @@ def _equal_dicts(a, b, ignore_keys):
|
|||
def _update_monitor(module, monitor, options):
|
||||
try:
|
||||
kwargs = dict(id=monitor['id'], query=module.params['query'],
|
||||
name=module.params['name'], message=_fix_template_vars(module.params['message']),
|
||||
name=_fix_template_vars(module.params['name']),
|
||||
message=_fix_template_vars(module.params['message']),
|
||||
escalation_message=_fix_template_vars(module.params['escalation_message']),
|
||||
options=options)
|
||||
if module.params['tags'] is not None:
|
||||
kwargs['tags'] = module.params['tags']
|
||||
|
|
Loading…
Reference in a new issue