diff --git a/gestion/gen_confs/firewall4.py b/gestion/gen_confs/firewall4.py index 57bf1c61..ace85c46 100755 --- a/gestion/gen_confs/firewall4.py +++ b/gestion/gen_confs/firewall4.py @@ -100,20 +100,7 @@ class firewall_base(object) : if not chain: for chain in self.chain_list[table]: self.delete(table, chain) - self.clear(table, chain) - def flush(self, table=None, chain=None): - if not table: - for table in tables: - self.flush(table, chain) - if not chain: - for chain in self.chain_list[table]: - self.flush(table, chain) - self.clear(table, chain) - self.chain_list[table].append(chain) - self.rules_list[table][chain]=[] - - def clear(self, table, chain): if not chain in self.chain_list[table]: return if not chain in default_chains: @@ -122,7 +109,18 @@ class firewall_base(object) : else: self.rules_list[table][chain]=[] - def restore(self, noflush=False, table=None, chains=[]): + def flush(self, table=None, chain=None): + if not table: + for table in tables: + self.flush(table, chain) + if not chain: + for chain in self.chain_list[table]: + self.flush(table, chain) + if not chain in self.chain_list[table]: + self.chain_list[table].append(chain) + self.rules_list[table][chain]=[] + + def restore(self, table=None, chains=[], noflush=False): str=self.format(chains) f=open('/tmp/ipt_rules', 'w') f.write(str)