X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfatables%2Fruntime.py;h=235c67f2590e61e962c0d12e232a442e0418fba1;hb=87121ca63d2b95bb155ea2adc5fd7c61d5cddcbe;hp=9e9b49aa9292e16d28fb6ebb97228f5c416fcffc;hpb=f9abcfad4e3c038068152ebbbcead1bfc8329145;p=sfa.git diff --git a/sfatables/runtime.py b/sfatables/runtime.py index 9e9b49aa..235c67f2 100644 --- a/sfatables/runtime.py +++ b/sfatables/runtime.py @@ -6,16 +6,16 @@ import pdb import libxml2 from optparse import OptionParser -from sfatables import commands, matches, targets -from sfatables.xmlextension import Xmlextension +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.contexts = 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)) @@ -39,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