From dd4d0e6b1b0ca29e5591cddb288efd6fc5ce927d Mon Sep 17 00:00:00 2001 From: salles Date: Sat, 11 Mar 2006 17:13:20 +0100 Subject: [PATCH] Commentaire et nom de variables plus explicites darcs-hash:20060311161320-72cb0-152bcf7c571c82ba9d7f512b5edb76ecd1f73815.gz --- surveillance/deconnexion.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/surveillance/deconnexion.py b/surveillance/deconnexion.py index b8e4412c..262a319c 100755 --- a/surveillance/deconnexion.py +++ b/surveillance/deconnexion.py @@ -42,6 +42,9 @@ def machine_online(machine) : return not commands.getstatusoutput('/usr/sbin/arping -c 3 %s' % machine.mac())[0] def generate_ps(sanction, proprio) : + """En fonction de la sanction à appliquer au propriétaire, + on génère la feuille de déconnexion et on retourne son nom et + emplacement.""" # Dossier de génération du ps dossier = '/usr/scripts/surveillance/fiche_deconnexion' @@ -175,15 +178,15 @@ uploadeurs = curseur.fetchall() # Table des avertis ################### -# Avertis hard +# Avertis upload hard requete = "SELECT type,id FROM avertis_upload_hard where date>timestamp 'now' - interval '1 day'" curseur.execute(requete) -avertis_hard = curseur.fetchall() +avertis_upload_hard = curseur.fetchall() -# Avertis soft +# Avertis upload soft requete = "SELECT type,id FROM avertis_upload_soft where date>timestamp 'now' - interval '1 day'" curseur.execute(requete) -avertis_soft = curseur.fetchall() +avertis_upload_soft = curseur.fetchall() # Vérification : ################ @@ -192,7 +195,7 @@ for elupload, eltype, elid in uploadeurs: if elupload >= upload.hard: # L'adhérent a t il été blacklisté ? #################################### - if [eltype,elid] in avertis_hard: + if [eltype,elid] in avertis_upload_hard: continue # Propriétaire issu de LDAP @@ -249,7 +252,7 @@ for elupload, eltype, elid in uploadeurs: elif elupload >= upload.soft : # L'adhérent a t il été averti ############################## - if [eltype,elid] in avertis_soft: + if [eltype,elid] in avertis_upload_soft: continue # Objets LDAP