From b115e9079f8e7ffbba1748fc7ec7156f2c758dee Mon Sep 17 00:00:00 2001 From: Nicolas Dandrimont Date: Fri, 13 Feb 2009 01:11:46 +0100 Subject: [PATCH] =?UTF-8?q?[gen=5Fconfs/firewall]=20On=20enl=C3=A8ve=20un?= =?UTF-8?q?=20peu=20de=20tuyauterie...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit darcs-hash:20090213001146-ffbb2-e3c19a5b9eaf605c2656cb43e0136b5666180c9b.gz --- gestion/gen_confs/firewall.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gestion/gen_confs/firewall.py b/gestion/gen_confs/firewall.py index 0f78452e..fafdaaf6 100755 --- a/gestion/gen_confs/firewall.py +++ b/gestion/gen_confs/firewall.py @@ -710,9 +710,8 @@ class firewall_komaz(firewall_crans) : # Il faut supprimer cette entrée iptables_option = '-D' subnet = IpSubnet(ip, conf_fw.mask[-1]) - regles = iptables("-t mangle -L SUBNET-%(subnet)s -n | " - "tee `tempfile -s _firewall`date -u +%y%m%d%H%M%S``" - "| grep %(ip)s" % locals()).split('\n') + all_regles = iptables("-t mangle -L SUBNET-%(subnet)s -n" % locals()).split('\n') + regles = [line for line in all_regles if ip in line] # On sélectionne la première qui doit contenir ce que l'on veut regle = regles[0].split() class_id = int(regle[7].split(':')[1])