log inconsistency warning email

This commit is contained in:
forest 2020-05-21 21:45:38 -05:00
parent e2c51d067e
commit f74a361c5f

View File

@ -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",