diff options
Diffstat (limited to 'python/mtm_status.py')
| -rw-r--r-- | python/mtm_status.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/python/mtm_status.py b/python/mtm_status.py index 1d61bfc5..22be1810 100644 --- a/python/mtm_status.py +++ b/python/mtm_status.py @@ -13,6 +13,8 @@ def latest(f): def run(conn, date): sftp = SftpClient.from_creds("mtm") files = [f for f in sftp.client.listdir("outbound") if date.strftime("%m%d%Y") in f] + if not files: + return target_file = max(files, key=latest) with sftp.client.open(f"outbound/{target_file}") as sftp_handle: |
