aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-11 10:53:43 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-11 10:53:43 -0700
commit39d7a0741d5573a26cac3f91cc0e59cae97b755b (patch)
tree0eba09f3ae28381ccdd10fc3d962abfaf881b524 /pym/portage/mail.py
parentFix typo in comment. (diff)
downloadportage-39d7a0741d5573a26cac3f91cc0e59cae97b755b.tar.gz
portage-39d7a0741d5573a26cac3f91cc0e59cae97b755b.tar.bz2
portage-39d7a0741d5573a26cac3f91cc0e59cae97b755b.zip
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.
Diffstat (limited to 'pym/portage/mail.py')
-rw-r--r--pym/portage/mail.py4
1 files changed, 2 insertions, 2 deletions
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")