From cbbda2241613866ab63ae313f90abc777c945485 Mon Sep 17 00:00:00 2001 From: Jake Smith <jws52@cam.ac.uk> Date: Thu, 12 Jan 2023 17:00:35 +0000 Subject: [PATCH] fix: Scraper emailing and uploading --- coordinator/ProcessorScraper.py | 5 +++-- coordinator/ProcessorServer.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/coordinator/ProcessorScraper.py b/coordinator/ProcessorScraper.py index 421bd15..b4e1af5 100644 --- a/coordinator/ProcessorScraper.py +++ b/coordinator/ProcessorScraper.py @@ -18,6 +18,7 @@ import smtplib import ssl import subprocess +import certifi from numpy import where from pandas import concat, DataFrame, read_csv, Series, set_option @@ -318,8 +319,8 @@ def send_email( maintainers = gmail_config['toaddrs'] # Create a secure SSL context - context = ssl.create_default_context() - + context = ssl.create_default_context(cafile=certifi.where()) + # It is indicated that gmail requires port 465 for SMTP_SSL, otherwise port # 587 with .starttls() from # https://realpython.com/python-send-email/#sending-a-plain-text-email I diff --git a/coordinator/ProcessorServer.py b/coordinator/ProcessorServer.py index 5f2a047..68ea5dd 100644 --- a/coordinator/ProcessorServer.py +++ b/coordinator/ProcessorServer.py @@ -105,6 +105,7 @@ def upload(config,FilesToSend,component): 'Deposition' : usual_path, 'Epidemiology' : usual_path, 'Survey' : f"SURVEYDATA_{config['StartString']}_0000/", + 'Scraper' : usual_path, 'Advisory' : usual_path } -- GitLab