diff --git a/papi/main.py b/papi/main.py index 093d444..dad945e 100644 --- a/papi/main.py +++ b/papi/main.py @@ -112,8 +112,11 @@ class Notifier: "status": ["Le monitoring est inacessible"], } ) - conf = PROBES[idsonde] - + try: + conf = PROBES[idsonde] + except KeyError: + logger.info(f"{idsonde} not found in probe") + return subject = "Probleme api supervision" content = kind from papi.mail_sendermodel import sendmail @@ -179,7 +182,10 @@ def last_notif_text(request: Request, idsonde: str): try: recipients = sondeid2notifsemails(idsonde) except KeyError: # pragma: no cover - recipients = ["mail1@xxx", "mail2@xxx"] + + # breakpoint() + + recipients = ["mail1@xxx", "mail2@xxx", f"{idsonde}@fqdn"] changements = content["changes"] status = content["status"] @@ -212,7 +218,7 @@ def post_sonde_error( if idsonde != "test": raise LookupError(f"{idsonde} not found") - Notifier.error_sonde(idsonde, body["msg"]) + Notifier.error_sonde(idsonde, body.get("msg")) # create fake sample try: