fixme: Bypas various bad designe choices
This commit is contained in:
parent
4dce2bd91d
commit
148e6416c9
14
papi/main.py
14
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:
|
||||
|
|
Loading…
Reference in New Issue