X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfatables%2Fruntime.py;h=b7c3444d362ba4d0d7798a956bffb4ad514a428f;hb=e8d18d70468b223f3e0f46fa7941e062f0477aa8;hp=a5363352d6a191e307304754de213012a9f2c2a1;hpb=cf4cfc2fd8cc0260d5cdce30c6fe0d42d0e40cd1;p=sfa.git diff --git a/sfatables/runtime.py b/sfatables/runtime.py index a5363352..b7c3444d 100644 --- a/sfatables/runtime.py +++ b/sfatables/runtime.py @@ -2,14 +2,13 @@ import sys import os -import pdb + import libxml2 +import libxslt -from optparse import OptionParser -from sfatables import commands -from sfatables.globals import * -from sfatables.commands.List import * -from sfatables.xmlrule import * +from sfatables.globals import sfatables_config +from sfatables.commands.List import List +from sfatables.xmlrule import XMLRule class SFATablesRules: def __init__(self, chain_name): @@ -57,8 +56,8 @@ class SFATablesRules: def add_request_context_to_rspec(self, doc): p = doc.xpathNewContext() - context = p.xpathEval("//RSpec") - if (not context): + context = p.xpathEval("//*") + if not context or context[0].name not in ['RSpec', 'rspec']: raise Exception('Request is not an rspec') else: # Add the request context