X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfatables%2Fruntime.py;h=d7eb6d49722c71c984336ec9b36b9f4136e83deb;hb=31cc4fa991896f000abb106916662923f37bc3a6;hp=e22967c783f55998dbe073a982866bf545b8755a;hpb=e39e728991b762ae0b52b52b06655f0c7f1b7421;p=sfa.git diff --git a/sfatables/runtime.py b/sfatables/runtime.py index e22967c7..d7eb6d49 100644 --- a/sfatables/runtime.py +++ b/sfatables/runtime.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 import sys import os @@ -56,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