a little nicer wrt pep8
[sfa.git] / sfatables / processors / legacy-restrict-to-nodes.xsl
index a0e8057..6548ceb 100644 (file)
@@ -9,14 +9,14 @@
         </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.-->
     <xsl:template match="NodeSpec">
             <xsl:choose>
-                <xsl:when test="ends-with(@name,$whitelist_suffix) and not($blacklist_suffix and ends-with(@name,$blacklist_suffix))">
+                <xsl:when test="(not($whitelist_suffix) or contains(@name,$whitelist_suffix)) and (not($blacklist_suffix) or not(contains(@name,$blacklist_suffix)))">
                     <xsl:copy-of select="."/>
                 </xsl:when>
                 <xsl:otherwise/>