</xsl:copy>
</xsl:template>
- <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"/>
+ <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.-->
<!-- End of magic sauce -->
<!-- Read in the value of the argument. See 'example_vini_rspec.xml' for an example of such an argument -->
- <xsl:variable name="max-link-bandwidth" select="//rspec//target-context/argument[name='max-link-bandwidth']/value"/>
+ <xsl:variable name="max-link-bandwidth" select="//RSpec//target-context/argument[name='max-link-bandwidth']/value"/>
<!-- Drop Linkspecs for which bw > max-link-bandwidth -->
<xsl:template match="LinkSpec">
</xsl:copy>
</xsl:template>
- <xsl:variable name="whitelist_prefix" select="//rspec//target-context/argument[name='whitelist']/value"/>
- <xsl:variable name="blacklist_prefix" select="//rspec//target-context/argument[name='blacklist']/value"/>
+ <xsl:variable name="whitelist_prefix" select="//RSpec//target-context/argument[name='whitelist']/value"/>
+ <xsl:variable name="blacklist_prefix" select="//RSpec//target-context/argument[name='blacklist']/value"/>
<!-- Drop nodes that are not in the whitelist -->
<xsl:template match="node">
+ <xsl:value-of select="$blacklist_prefix"/>
<xsl:choose>
<xsl:when test="starts-with(@name,$whitelist_prefix) and not($blacklist_prefix and starts-with(@name,$blacklist_prefix))">
<xsl:copy-of select="."/>
childNode = self.create_xml_node(k, context_dict[k])
node.addChild(childNode)
else:
- node.addContent(context_dict[k])
+ childNode = libxml2.newNode(k)
+ childNode.addContent(context_dict[k])
+ node.addChild(childNode)
return node
def add_request_context_to_rspec(self, doc):
def main():
incoming = SFATablesRules('INCOMING')
- incoming.set_context({'sfa':{'user':{'hrn':'ple.princeton.sapanb'}}})
+ incoming.set_context({'sfa':{'user':{'hrn':'plc.princeton.sapanb'}}})
outgoing = SFATablesRules('OUTGOING')
print "%d rules loaded for INCOMING chain"%len(incoming.sorted_rule_list)
<RSpec>
<request-context><sfa><user><hrn>plc.princeton.sapanb</hrn></user></sfa></request-context>
<match-context><argument><name>user-hrn</name><value>plc.princeton.sapanb</value></argument></match-context>
+ <target-context><argument><name>blacklist</name><value>plc.tp</value></argument></target-context>
<request>
<nodespec>
<node name="plc.princeton.planetlab-01"/>