aboutsummaryrefslogtreecommitdiffstats
path: root/python/mtm_status.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/mtm_status.py')
-rw-r--r--python/mtm_status.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/python/mtm_status.py b/python/mtm_status.py
index 385b8e4c..a8e78254 100644
--- a/python/mtm_status.py
+++ b/python/mtm_status.py
@@ -4,6 +4,8 @@ import pandas as pd
from serenitas.utils.db import dbconn
from psycopg2.errors import UniqueViolation
from zipfile import ZipFile
+from paramiko.ssh_exception import AuthenticationException
+import logging
def latest(f):
@@ -11,7 +13,11 @@ def latest(f):
def run(conn, date):
- sftp = SftpClient.from_creds("mtm")
+ try:
+ sftp = SftpClient.from_creds("mtm")
+ except AuthenticationException as e:
+ logger.warning(e)
+ pass
files = [f for f in sftp.client.listdir("outbound") if date.strftime("%m%d%Y") in f]
if not files:
return
@@ -79,5 +85,6 @@ def run(conn, date):
if __name__ == "__main__":
+ logger = logging.getLogger(__name__)
conn = dbconn("dawndb")
run(conn, datetime.date.today())