From 9118b871aded2371846aab21e1056d3ffd8e9875 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Fri, 2 Oct 2009 14:34:52 +0000 Subject: [PATCH] - SFATablesRules for rspec_manager:fetch_context(...) which is not yet implemented. --- sfatables/runtime.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sfatables/runtime.py b/sfatables/runtime.py index 0a73482a..b3845164 100644 --- a/sfatables/runtime.py +++ b/sfatables/runtime.py @@ -6,15 +6,16 @@ import pdb import libxml2 from optparse import OptionParser -from sfatables import commands, matches, targets +from sfatables import commands from sfatables.globals import * from sfatables.commands.List import * from sfatables.xmlrule import * class SFATablesRules: def __init__(self, chain_name): + self.context = None # placeholder for rspec_manger self.sorted_rule_list = [] - chain_dir_path = "%s/%s"%(sfatables_config,chain_name) + chain_dir_path = os.path.join(sfatables_config,chain_name) rule_list = List().get_rule_list(chain_dir_path) for rule_number in rule_list: self.sorted_rule_list.append(XMLRule(chain_name, rule_number)) @@ -38,11 +39,10 @@ def main(): incoming = SFATablesRules('INCOMING') outgoing = SFATablesRules('OUTGOING') - rspec = open(sys.argv[1]).read() - - print "%d rules loaded for INCOMING chain\n"%len(incoming.sorted_rule_list) - print "%d rules loaded for OUTGOING chain\n"%len(outgoing.sorted_rule_list) + print "%d rules loaded for INCOMING chain"%len(incoming.sorted_rule_list) + print "%d rules loaded for OUTGOING chain"%len(outgoing.sorted_rule_list) + rspec = open(sys.argv[1]).read() newrspec = incoming.apply(rspec) print newrspec return -- 2.43.0