Skip to content
Snippets Groups Projects
Commit dc6b231b authored by Amine  GHOZLANE's avatar Amine GHOZLANE
Browse files

Check if on shinypro to send mail

parent e9e23877
No related branches found
No related tags found
No related merge requests found
pip3 install bioblend python-daemon
This diff is collapsed.
...@@ -35,6 +35,7 @@ import tarfile ...@@ -35,6 +35,7 @@ import tarfile
import zipfile import zipfile
import lockfile import lockfile
import datetime import datetime
import socket
class FullPaths(argparse.Action): class FullPaths(argparse.Action):
"""Expand user- and relative-paths""" """Expand user- and relative-paths"""
...@@ -418,11 +419,12 @@ class galaxy(Thread): ...@@ -418,11 +419,12 @@ class galaxy(Thread):
"attachment; filename= {0}" "attachment; filename= {0}"
.format(os.path.basename(result_file))) .format(os.path.basename(result_file)))
msg.attach(part) msg.attach(part)
server = smtplib.SMTP('smtp.pasteur.fr', 587) if socket.gethostname() == "ShinyPro":
server.starttls() server = smtplib.SMTP('smtp.pasteur.fr', 587)
text = msg.as_string() server.starttls()
server.sendmail(fromaddr, toaddr, text) text = msg.as_string()
server.quit() server.sendmail(fromaddr, toaddr, text)
server.quit()
#smtplib.SMTPSenderRefused: #smtplib.SMTPSenderRefused:
#except IOError: #except IOError:
# self.logger.error("Error cannot open {0}".format(result_file)) # self.logger.error("Error cannot open {0}".format(result_file))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment