Commentaire et nom de variables plus explicites
darcs-hash:20060311161320-72cb0-152bcf7c571c82ba9d7f512b5edb76ecd1f73815.gz
This commit is contained in:
parent
04fac6dc56
commit
dd4d0e6b1b
1 changed files with 9 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue