Pour viter toute confusion future, on stocke les dates de blacklist en

nombre de secondes coules depuis Epoch.

darcs-hash:20060326040722-68412-25d9d48ded7ffc0279da4fbbeb74bdf610a33b2f.gz
This commit is contained in:
glondu 2006-03-26 06:07:22 +02:00
parent 9623054b9d
commit 230e01cc1b
3 changed files with 50 additions and 46 deletions

View file

@ -306,17 +306,17 @@ if __name__ == '__main__':
elif opt == '--reconnect':
# Personnes à reconnecter
print 'Recherche des personnes en fin de sanction...'
hier = strftime('%d/%m/%Y %H:%M'.split()[0], localtime(time() - 60*60*24))
c = db.search('blacklist=*,%s*' % hier)
c = db.search('blacklist=*')
services = []
hier = time() - 24*3600
for a_reco in c['adherent'] + c['machine'] + c['club']:
for bl in a_reco.blacklist():
fin, sanction = bl.split(',')[1:3]
if fin.split()[0] == hier and sanction not in services:
fin, sanction = bl.split('$')[1:3]
if fin > hier and sanction not in services:
services.append(sanction)
for s in services:
print "Ajout de blacklist_%s pour reconfiguration" % s
db.services_to_restart('blacklist_%s' % s.encode())
db.services_to_restart('blacklist_%s' % s)
sys.exit(0)
elif opt == '--add':