diff options
author | Jesse Keating <jkeating@j2solutions.net> | 2016-11-26 02:28:45 -0800 |
---|---|---|
committer | René Moser <mail@renemoser.net> | 2016-11-26 11:28:45 +0100 |
commit | b31d3786736255921777c50b544854fc8ac2fe06 (patch) | |
tree | dba8ce8038b044b33ff9c682293a9b23e8e3500f /monitoring | |
parent | 82191f724f327db4b29f9049808067f89a592eef (diff) | |
download | ansible-modules-extras-b31d3786736255921777c50b544854fc8ac2fe06.tar.gz |
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.
Diffstat (limited to 'monitoring')
-rw-r--r-- | monitoring/datadog_monitor.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/monitoring/datadog_monitor.py b/monitoring/datadog_monitor.py index 4688a0e5..8fe9ded9 100644 --- a/monitoring/datadog_monitor.py +++ b/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): |