From e90ea613d2abd90bc16cbacfc66f8b0650cd460f Mon Sep 17 00:00:00 2001 From: Taeber Rapczak Date: Tue, 5 Aug 2014 16:55:15 -0400 Subject: [PATCH] Remove hard-coded smtp.ufl.edu --- CHANGELOG | 4 ++++ bin/redi.py | 7 ++++++- setup.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8bbb572..b94ee16 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2014-08-05 v0.9.1 + + * HOTFIX to replace smtp.ufl.edu with configurable option in setup.json + 2014-08-01 v0.9.0 * Testing: Added Vagrant-based testing VM and documentation for how to use it diff --git a/bin/redi.py b/bin/redi.py index b51623e..00986ed 100755 --- a/bin/redi.py +++ b/bin/redi.py @@ -36,6 +36,9 @@ from redcap_transactions import redcap_transactions import redi_lib + +smtp_host_for_outbound_mail = None + # INTERMEDIATE STEPS: XML! # step 1: parse raw XML to ElementTree: "data" # step 1b: call read-in function to load xml into ElementTree @@ -75,6 +78,8 @@ def main(): # read config setup_json = proj_root+'config/setup.json' setup = read_config(setup_json) + global smtp_host_for_outbound_mail + smtp_host_for_outbound_mail = setup['smtp_host_for_outbound_mail'] # load custom post-processing rules rules = load_rules(setup, proj_root) @@ -881,7 +886,7 @@ def send_report(sender,receiver,body): """ try: - smtpObj = smtplib.SMTP('smtp.ufl.edu',25) + smtpObj = smtplib.SMTP(smtp_host_for_outbound_mail, 25) smtpObj.sendmail(sender, receiver, msg.as_string()) print "Successfully sent email to: " + str(receiver) except Exception: diff --git a/setup.py b/setup.py index d86463d..e6254fa 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name='REDI', - version='0.9.0', + version='0.9.1', author='Christopher P Barnes, Philip Chase, Nicholas Rejack', author_email='cpb@ufl.edu, pbc@ufl.edu, nrejack@ufl.edu', packages=find_packages(exclude=['test']),