From 9aaaae7e6a7041d0998a55f46df6732e0e72de3c Mon Sep 17 00:00:00 2001 From: Antoine Durand-Gasselin Date: Wed, 3 Jun 2009 19:18:43 +0200 Subject: [PATCH] =?UTF-8?q?[gen=5Fconfs/squid.py]=20On=20passage=20=C3=A0?= =?UTF-8?q?=20squid3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit darcs-hash:20090603171843-bd074-7f0d1fd6219968d70b1a5af31da16d33010f2dba.gz --- gestion/gen_confs/squid.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gestion/gen_confs/squid.py b/gestion/gen_confs/squid.py index cf1a1402..06324020 100644 --- a/gestion/gen_confs/squid.py +++ b/gestion/gen_confs/squid.py @@ -13,14 +13,14 @@ from config import bl_carte_et_actif class squid(gen_config) : db = crans_ldap() actif = True # la sanction est elle active ? - restart_cmd = '/etc/init.d/squid reload' - + restart_cmd = '/etc/init.d/squid3 reload' + def __str__(self) : return str(self.__class__).replace('_','-').split('.')[2] - + def _gen(self) : self._mklist() - + def _mklist(self) : fic = self._open_conf(self.FICHIER) @@ -32,15 +32,15 @@ class squid(gen_config) : # chaine de tri spéciale liste = self.db.search("paiement=ok&%s"%self.chaine) l_proprio = liste["adherent"] + liste["club"] - l_machine = liste["machine"] - + l_machine = liste["machine"] + else: # recherche dans les adhérents blacklistés liste = self.db.search("paiement=ok&ablacklist=*%s*"%self.chaine) l_proprio = liste["adherent"] + liste["club"] l_proprio = [ x for x in l_proprio if self.chaine in x.blacklist_actif() ] - - # recherche dans les machines blacklistés + + # recherche dans les machines blacklistés liste = self.db.search("paiement=ok&mblacklist=*%s*"%self.chaine) l_machine = liste["machine"] l_machine = [ m for m in l_machine if self.chaine in m.blacklist_actif() ] @@ -48,11 +48,11 @@ class squid(gen_config) : # on ajoute les machines des proprios aux autres machines for proprio in l_proprio : l_machine += proprio.machines() - + # on colle toutes les machines dans le fichier self.anim.iter=len(l_machine) for m in l_machine: - self.anim.cycle() + self.anim.cycle() fic.write( m.Nom() + '\n' ) fic.close() @@ -80,7 +80,7 @@ class squid_virus(squid) : """ Genère le fichier blacklist-virus pour squid """ FICHIER = "/etc/squid/blacklist_virus" chaine = "virus" - + class squid_warez(squid) : """ Genère le fichier blacklist-warez pour squid """ FICHIER = "/etc/squid/blacklist_warez" @@ -90,7 +90,7 @@ class squid_bloq(squid) : """ Genère le fichier blacklist-bloq pour squid """ FICHIER = "/etc/squid/blacklist_bloq" chaine = "bloq" - + class squid_carte(squid) : """ Genère le fichier blacklist-carte pour squid """ actif = bl_carte_et_actif