Bug fix
Sapan Bhatia [Mon, 26 Oct 2009 19:36:27 +0000 (19:36 +0000)]
sfatables/commands/Add.py
sfatables/processors/legacy-restrict-to-nodes.xsl

index c6f89a8..fc5ed71 100644 (file)
@@ -41,7 +41,7 @@ class Add(Command):
             option_name = option['name']
             option_value = getattr(options,option_name)
 
-            if (hasattr(options,option_name)):
+            if (hasattr(options,option_name) and options.option_name):
                 context = p.xpathEval("//rule[@element='%s' or @element='*']/argument[name='%s']"%(element, option_name))
                 if (not context):
                     raise Exception('Unknown option %s for match %s and element %s'%(option,option['name'], element))
index a0e8057..5e23184 100644 (file)
@@ -9,8 +9,8 @@
         </xsl:copy>
     </xsl:template>
 
-    <xsl:variable name="whitelist_suffix" select="//rspec//target-context/argument[name='whitelist']/value"/>
-    <xsl:variable name="blacklist_suffix" select="//rspec//target-context/argument[name='blacklist']/value"/>
+    <xsl:variable name="whitelist_suffix" select="//rspec//target-context/argument[name='whitelist-dns-suffix']/value"/>
+    <xsl:variable name="blacklist_suffix" select="//rspec//target-context/argument[name='blacklist-dns-suffix']/value"/>
 
     <!-- Drop nodes that are not in the whitelist. This is the legacy version that works on the current
     rspec. The current rspec refers to dns names, not sfa names for nodes.-->