diff options
author | Jesse Keating <jkeating@j2solutions.net> | 2016-11-26 02:28:45 -0800 |
---|---|---|
committer | Rene Moser <mail@renemoser.net> | 2016-11-26 13:11:46 +0100 |
commit | 97936bcc8a1a6a5a5610cdf261c8782b827ff2c8 (patch) | |
tree | 0756a39c08c5b8e5649b73bbe119024be1bcff54 | |
parent | ee637475cc8826c2b326d154a1b415bf2cbf32d4 (diff) | |
download | ansible-modules-extras-97936bcc8a1a6a5a5610cdf261c8782b827ff2c8.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.
(cherry picked from commit b31d3786736255921777c50b544854fc8ac2fe06)
-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 7ed1805c..9497120e 100644 --- a/monitoring/datadog_monitor.py +++ b/monitoring/datadog_monitor.py @@ -192,7 +192,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): |