summaryrefslogtreecommitdiffstats
path: root/wallace/module_resources.py
diff options
context:
space:
mode:
authorLiutauras Adomaitis <adomaitis@kolabsys.com>2018-05-25 09:06:39 +0300
committerLiutauras Adomaitis <adomaitis@kolabsys.com>2018-06-04 14:04:14 +0300
commit46f61ab9984e23332477d39edbf303291e04d2ca (patch)
tree4e6c59e3c2d817550a9704acdfc6f86a142ebd7b /wallace/module_resources.py
parent4986d1839643d9ba80fbe23c4ac8b40b0cbeef6d (diff)
downloadpykolab-46f61ab9984e23332477d39edbf303291e04d2ca.tar.gz
Fix D577 patch bug - modules._sendmail result assign to variable, which is used to log the result of email sending.
Summary: Define success variable to hold the _sendmail result. Test Plan: none Reviewers: vanmeeuwen, machniak Reviewed By: machniak Subscribers: petersen Differential Revision: https://git.kolab.org/D581
Diffstat (limited to 'wallace/module_resources.py')
-rw-r--r--wallace/module_resources.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index c216276..f5f8382 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -1312,7 +1312,6 @@ def send_owner_notification(resource, owner, itip_event, success=True):
"""
Send a reservation notification to the resource owner
"""
- import smtplib
from pykolab import utils
from email.MIMEText import MIMEText
from email.Utils import formatdate
@@ -1356,17 +1355,7 @@ def send_owner_notification(resource, owner, itip_event, success=True):
resource['cn'], participant_status_label(status) if success else _('failed')
))
- smtp = smtplib.SMTP("localhost", 10027)
-
- if conf.debuglevel > 8:
- smtp.set_debuglevel(True)
-
- try:
- smtp.sendmail(resource['mail'], owner['mail'], msg.as_string())
- except Exception, e:
- log.error(_("SMTP sendmail error: %r") % (e))
-
- smtp.quit()
+ modules._sendmail(resource['mail'], owner['mail'], msg.as_string())
def owner_notification_text(resource, owner, event, success):
organizer = event.get_organizer()