From: Frank Brehm Date: Wed, 25 Aug 2021 11:18:47 +0000 (+0200) Subject: Changing output of generated mail X-Git-Tag: 1.7.6^2~4 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=8dcf6a216d0c8bb835427270bd5a2d280eb18342;p=pixelpark%2Fpuppetmaster-webhooks.git Changing output of generated mail --- diff --git a/lib/webhooks/base_app.py b/lib/webhooks/base_app.py index 2511947..8917994 100644 --- a/lib/webhooks/base_app.py +++ b/lib/webhooks/base_app.py @@ -1168,17 +1168,14 @@ class BaseHookApp(BaseApplication): msg['X-Mailer'] = "Puppetmaster deploy script v.{}".format(__version__) - if self.verbose: - LOG.info(_("Sending the following mail to {r!r} via {s}:{p}:\n{m}").format( - r=to_addresses, m=msg.as_string(unixfrom=True), - s=self.smtp_server, p=self.smtp_port)) - else: - LOG.info(_("Sending a mail to {r!r} via {s}:{p}:\n{e}").format( - r=to_addresses, e=pp(self.error_data), - s=self.smtp_server, p=self.smtp_port)) + LOG.info(_("Sending a mail to {r!r} via {s}:{p}.").format( + r=to_addresses, s=self.smtp_server, p=self.smtp_port)) + + if self.verbose or self.no_error_mail: + print(self.colored(_('Content of the mail:'), 'AQUA') + '\n' + body) if self.no_error_mail: - LOG.debug(_("It's undesired to send error mails.")) + LOG.info(_("It's undesired to send error mails.")) return if self.simulate: