On Jan 8, 2016 11:03 AM, "Emil Natan" <shly...@gmail.com> wrote:
>
> Hello list,
>
> I have a function which receives a string and sends it as a body of an
> email.
>
> It is a part of a program which does certain checks on network
> infrastructure. When a check fails I append error message to a
> error_collector list:
>
>
> if self.check_axfr_refused(ip):
>      error_collector.append('%s:%s AXFR test for %s FAILED' %
>                                            (ns, ip, self.domainname))
>
> At the  end I send the alert like this:
>
> if len(error_collector) != 0:
>         email_body = str(error_collector)
>         email_alert(email_body)
Instead of str( str(error_collector) ) try '\n'.join(error_collector)
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to