From 39d7a0741d5573a26cac3f91cc0e59cae97b755b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 11 Sep 2010 10:53:43 -0700 Subject: Make the mail_summary elog module copy needed variables from the config instance, since we don't need to hold a reference for the whole thing. This also makes it possible to rely on per-package variable settings that may have come from /etc/portage/package.env, since we'll be isolated from any future mutations of mysettings. --- pym/portage/mail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pym/portage/mail.py') diff --git a/pym/portage/mail.py b/pym/portage/mail.py index 362b00510..f87efe262 100644 --- a/pym/portage/mail.py +++ b/pym/portage/mail.py @@ -92,7 +92,7 @@ def send_mail(mysettings, message): # mailserver: smtp server that should be used to deliver the mail (defaults to localhost) # alternatively this can also be the absolute path to a sendmail binary if you don't want to use smtp # port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) - if " " in mysettings["PORTAGE_ELOG_MAILURI"]: + if " " in mysettings.get("PORTAGE_ELOG_MAILURI", ""): myrecipient, mymailuri = mysettings["PORTAGE_ELOG_MAILURI"].split() if "@" in mymailuri: myauthdata, myconndata = mymailuri.rsplit("@", 1) @@ -107,7 +107,7 @@ def send_mail(mysettings, message): else: mymailhost = myconndata else: - myrecipient = mysettings["PORTAGE_ELOG_MAILURI"] + myrecipient = mysettings.get("PORTAGE_ELOG_MAILURI", "") myfrom = message.get("From") -- cgit v1.2.3-65-gdbad