diff --git a/gestion/gen_confs/generate.py b/gestion/gen_confs/generate.py index 03f47709..c2fb4f69 100755 --- a/gestion/gen_confs/generate.py +++ b/gestion/gen_confs/generate.py @@ -381,15 +381,17 @@ if __name__ == '__main__': print 'Recherche des personnes en fin de sanction...' c = db.search('blacklist=*') services = [] + nom = time() hier = time() - 24*3600 + demain = 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 > hier and sanction not in services: - services.append(sanction) - for s in services: + if fin != '-' and fin <= demain and fin >= now and (sanction, fin) not in services: + services.append((sanction, fin)) + for s,f in services: print "Ajout de blacklist_%s pour reconfiguration" % s - db.services_to_restart('blacklist_%s' % s) + db.services_to_restart('blacklist_%s' % s, start=f) sys.exit(0) elif opt == '--add':