Correction alerte_sms.py sur develop

This commit is contained in:
2025-05-12 01:32:23 +02:00
parent 787d2c3a40
commit 38081329fa
2 changed files with 2 additions and 27 deletions

View File

@@ -8,8 +8,8 @@ load_dotenv()
# Dictionnaire des numéros par site
PHONE_NUMBERS_BY_SITE = {
"Saclay": ["+33635164680", "+33650270939","+33682069405"],
"Meudon": ["+33616443455"],
'Saclay': os.getenv('PHONE_SACLAY', '').split(','),
'Meudon': os.getenv('PHONE_MEUDON', '').split(','),
# ajoute d'autres sites ici
}
# Dossier de logs

View File

@@ -1,25 +0,0 @@
import ovh
import os
from dotenv import load_dotenv
load_dotenv()
def envoyer_sms_ovh(message, phone_number):
client = ovh.Client(
endpoint=os.getenv("OVH_ENDPOINT"),
application_key=os.getenv("OVH_APP_KEY"),
application_secret=os.getenv("OVH_APP_SECRET"),
consumer_key=os.getenv("OVH_CONSUMER_KEY"),
)
account = os.getenv("OVH_SMS_ACCOUNT") # Nom du service SMS OVH
# Envoi du SMS
result = client.post(f'/sms/{account}/jobs',
sender='Supervision', # nom affiché sur certains téléphones
message=message,
receivers=phone_number,
priority='high',
noStopClause=True,
)
return result