From f6e47e4055a26362eaf87cee0948531ecbefb43c Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Sat, 26 Nov 2016 02:28:45 -0800 Subject: [PATCH] Handle empty datadog_monitor message (#3468) Since message is not required, it may be of type None, which cannot have a replace() called on it. --- lib/ansible/modules/extras/monitoring/datadog_monitor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/monitoring/datadog_monitor.py b/lib/ansible/modules/extras/monitoring/datadog_monitor.py index 4688a0e5944..8fe9ded9be3 100644 --- a/lib/ansible/modules/extras/monitoring/datadog_monitor.py +++ b/lib/ansible/modules/extras/monitoring/datadog_monitor.py @@ -197,7 +197,9 @@ def main(): unmute_monitor(module) def _fix_template_vars(message): - return message.replace('[[', '{{').replace(']]', '}}') + if message: + return message.replace('[[', '{{').replace(']]', '}}') + return message def _get_monitor(module):