Module: check_mk
Branch: master
Commit: 59baec56c32bdb5dfe5e0063573a627bdcaabd5a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=59baec56c32bdb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon May 8 09:52:10 2017 +0200
4611 FIX check_mail_loop: Fixed exception 'module' object has no attribute ‘text’
Change-Id: I4a47c9c3e452e761c9f73bfc0e100a1759844031
---
.werks/4611 | 11 +++++++++++
active_checks/check_mail_loop | 4 +++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/4611 b/.werks/4611
new file mode 100644
index 0000000..4b3e322
--- /dev/null
+++ b/.werks/4611
@@ -0,0 +1,11 @@
+Title: check_mail_loop: Fixed exception 'module' object has no attribute ‘text’
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1494229905
+
+
diff --git a/active_checks/check_mail_loop b/active_checks/check_mail_loop
index 5b707ee..25a57b3 100755
--- a/active_checks/check_mail_loop
+++ b/active_checks/check_mail_loop
@@ -27,6 +27,8 @@
import sys, getopt, os, time, random, poplib, imaplib, smtplib, email
import traceback, socket, re
+from email.mime.text import MIMEText
+
def parse_exception(e):
e = str(e)
if e[0] == '{':
@@ -324,7 +326,7 @@ def send_mail():
now = time.time()
key = random.randint(1, 1000)
- mail = email.mime.text.MIMEText("")
+ mail = MIMEText("")
mail['From'] = mail_from
mail['To'] = mail_to
mail['Subject'] = '%s %d %d' % (subject, now, key)