[config,firewall_new,ipt,ldap_crans] bl_carte_et_definitif = True, sursis d'une semaine même avec bl_carte_et_definitif

Ignore-this: aef64ec3880b96beda0ec95c7c6c255c

darcs-hash:20121119160943-3a55a-309f4e1bf82cc4ef955c7a7a723220704e74ba18.gz
This commit is contained in:
Valentin Samir 2012-11-19 17:09:43 +01:00
parent 11f461576b
commit b92229f0f1
4 changed files with 63 additions and 21 deletions

View file

@ -25,7 +25,7 @@ import os, re, syslog, cPickle
from ldap_crans import crans_ldap, hostname
from commands import getstatusoutput
from config import NETs, role, prefix, mid, output_file, filter_policy
from config import blacklist_sanctions, blacklist_sanctions_soft, file_pickle
from config import blacklist_sanctions, blacklist_sanctions_soft, file_pickle, ann_scol, periode_transitoire
from iptools import AddrInNet
from midtools import Mid
import subprocess
@ -667,14 +667,21 @@ def blacklist(ipt):
blcklst = []
s = db.search('paiement=ok')
s = db.search('paiement=%s' % ann_scol)
if periode_transitoire:
tmp=db.search('paiement=%s' % ann_scol-1)
s['adherent'].entend(tmp['adherent'])
s['club'].entend(tmp['club'])
del tmp
for target in s['adherent'] + s['club']:
sanctions = target.blacklist_actif()
if [x for x in sanctions if x in blacklist_sanctions]:
blcklst.extend(target.machines())
s = db.search('mblacklist=*&paiement=ok')
s = db.search('mblacklist=*&paiement=%s' % ann_scol)
if periode_transitoire:
s['machine'].entend(db.s('mblacklist=*&paiement=%s' % ann_scol-1)['machine'])
for target in s['machine']:
sanctions = target.blacklist_actif()