From f74a361c5fefa767b341a94d0ab77005f8eceff5 Mon Sep 17 00:00:00 2001 From: forest Date: Thu, 21 May 2020 21:45:38 -0500 Subject: [PATCH] log inconsistency warning email --- capsulflask/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/capsulflask/cli.py b/capsulflask/cli.py index 9c45f7c..2bad017 100644 --- a/capsulflask/cli.py +++ b/capsulflask/cli.py @@ -268,6 +268,11 @@ def ensure_vms_and_db_are_synced(): if len(errors) > 0: email_addresses_raw = current_app.config['ADMIN_EMAIL_ADDRESSES'].split(",") email_addresses = list(filter(lambda x: len(x) > 6, map(lambda x: x.strip(), email_addresses_raw ) )) + + current_app.logger.info(f"cron_task: sending inconsistency warning email to {','.join(email_addresses)}:") + for error in errors: + current_app.logger.info(f"cron_task: {error}.") + current_app.config["FLASK_MAIL_INSTANCE"].send( Message( "Capsul Consistency Check Failed",