pld-builder.new: PLD_Builder/mailer.py Don't even try to send emai...
arekm
arekm at pld-linux.org
Sun Apr 1 12:47:45 CEST 2007
Author: arekm Date: Sun Apr 1 10:47:45 2007 GMT
Module: pld-builder.new Tag: HEAD
---- Log message:
Don't even try to send email if sendmail isn't installed. Log instead.
---- Files affected:
pld-builder.new/PLD_Builder:
mailer.py (1.19 -> 1.20)
---- Diffs:
================================================================
Index: pld-builder.new/PLD_Builder/mailer.py
diff -u pld-builder.new/PLD_Builder/mailer.py:1.19 pld-builder.new/PLD_Builder/mailer.py:1.20
--- pld-builder.new/PLD_Builder/mailer.py:1.19 Tue Jul 4 16:09:53 2006
+++ pld-builder.new/PLD_Builder/mailer.py Sun Apr 1 12:47:40 2007
@@ -7,6 +7,7 @@
from config import config
import util
+import log
def recode(s):
if s.__class__ == ''.__class__:
@@ -72,7 +73,10 @@
util.sendfile(self.body, f)
def send(self):
+ if not os.path.exists("/usr/sbin/sendmail"):
+ log.alert("/usr/sbin/sendmail doesn't exists: can't send email")
+ return False
send_sendmail = "/usr/sbin/sendmail -i -t -f %s" % config.admin_email
f = os.popen(send_sendmail, "w")
self.write_to(f)
- f.close()
+ return f.close()
================================================================
---- CVS-web:
http://cvs.pld-linux.org/pld-builder.new/PLD_Builder/mailer.py?r1=1.19&r2=1.20&f=u
More information about the pld-cvs-commit
mailing list