send-nagios-notification: Use a codeblock rather than a block quote.

This ensures that Humbug receives the verbatim text of the Nagios
body, rather than a slightly modified version.  Tested by running
manually.

(imported from commit 7e0eea0b230fd8c5552860acfb7372099598f036)
This commit is contained in:
Tim Abbott 2013-01-02 10:22:25 -05:00
parent f65b130b45
commit 506eac99d6

View file

@ -40,8 +40,8 @@ msg['content'] = '**%s**: %s is %s' % (opts.type, thing, opts.state)
# We will be more conservative and handle just this one escape sequence.
output = (opts.output + '\n' + opts.long_output.replace(r'\n', '\n')).strip()
if output:
# Block-quote any command output.
msg['content'] += ('\n\n' + '\n'.join('> ' + ln for ln in output.splitlines()))
# Put any command output in a code block.
msg['content'] += ('\n\n~~~~\n' + output + "\n~~~~\n")
client = humbug.Client(
email = 'humbug+nagios@humbughq.com',