git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7c42b6c
)
Bug fixes and cleanups
author
Sapan Bhatia
<sapanb@cs.princeton.edu>
Mon, 26 Oct 2009 03:15:57 +0000
(
03:15
+0000)
committer
Sapan Bhatia
<sapanb@cs.princeton.edu>
Mon, 26 Oct 2009 03:15:57 +0000
(
03:15
+0000)
sfatables/commands/Add.py
patch
|
blob
|
history
sfatables/processors/link/restrict_slice.xml
patch
|
blob
|
history
sfatables/processors/max_link_bandwidth.xsl
patch
|
blob
|
history
sfatables/processors/restrict_to_nodes.xsl
patch
|
blob
|
history
sfatables/test.sfarspec
patch
|
blob
|
history
sfatables/xmlrule.py
patch
|
blob
|
history
diff --git
a/sfatables/commands/Add.py
b/sfatables/commands/Add.py
index
da02e86
..
c6f89a8
100644
(file)
--- a/
sfatables/commands/Add.py
+++ b/
sfatables/commands/Add.py
@@
-4,12
+4,11
@@
from sfatables.command import Command
from sfatables.globals import *
class Add(Command):
from sfatables.globals import *
class Add(Command):
- options = [('-A','--add')]
- help = 'Add a rule to a chain'
- matches = True
- targets = True
-
def __init__(self):
def __init__(self):
+ self.options = [('-A','--add')]
+ self.help = 'Add a rule to a chain'
+ self.matches = True
+ self.targets = True
return
def getnextfilename(self,type,chain):
return
def getnextfilename(self,type,chain):
diff --git
a/sfatables/processors/link/restrict_slice.xml
b/sfatables/processors/link/restrict_slice.xml
index
37c56d4
..
ee641cc
100644
(file)
--- a/
sfatables/processors/link/restrict_slice.xml
+++ b/
sfatables/processors/link/restrict_slice.xml
@@
-11,7
+11,7
@@
<!-- End of magic sauce -->
<!-- Read in the value of the argument. See 'example_vini_rspec.xml' for an example of such an argument -->
<!-- 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//
sfatables-rule
/argument[name='max-link-bandwidth']/value"/>
+ <xsl:variable name="max-link-bandwidth" select="//RSpec//
rule-context
/argument[name='max-link-bandwidth']/value"/>
<!-- Drop Linkspecs for which bw > max-link-bandwidth -->
<xsl:template match="LinkSpec">
<!-- Drop Linkspecs for which bw > max-link-bandwidth -->
<xsl:template match="LinkSpec">
@@
-25,3
+25,4
@@
<xsl:template match="sfatables-input"/>
</xsl:stylesheet>
<xsl:template match="sfatables-input"/>
</xsl:stylesheet>
+>
diff --git
a/sfatables/processors/max_link_bandwidth.xsl
b/sfatables/processors/max_link_bandwidth.xsl
index
37c56d4
..
ee641cc
100644
(file)
--- a/
sfatables/processors/max_link_bandwidth.xsl
+++ b/
sfatables/processors/max_link_bandwidth.xsl
@@
-11,7
+11,7
@@
<!-- End of magic sauce -->
<!-- Read in the value of the argument. See 'example_vini_rspec.xml' for an example of such an argument -->
<!-- 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//
sfatables-rule
/argument[name='max-link-bandwidth']/value"/>
+ <xsl:variable name="max-link-bandwidth" select="//RSpec//
rule-context
/argument[name='max-link-bandwidth']/value"/>
<!-- Drop Linkspecs for which bw > max-link-bandwidth -->
<xsl:template match="LinkSpec">
<!-- Drop Linkspecs for which bw > max-link-bandwidth -->
<xsl:template match="LinkSpec">
@@
-25,3
+25,4
@@
<xsl:template match="sfatables-input"/>
</xsl:stylesheet>
<xsl:template match="sfatables-input"/>
</xsl:stylesheet>
+>
diff --git
a/sfatables/processors/restrict_to_nodes.xsl
b/sfatables/processors/restrict_to_nodes.xsl
index
f09a56f
..
492e383
100644
(file)
--- a/
sfatables/processors/restrict_to_nodes.xsl
+++ b/
sfatables/processors/restrict_to_nodes.xsl
@@
-9,8
+9,8
@@
</xsl:copy>
</xsl:template>
</xsl:copy>
</xsl:template>
- <xsl:variable name="whitelist_prefix" select="//rspec//
sfatables-rule
/argument[name='whitelist']/value"/>
- <xsl:variable name="blacklist_prefix" select="//rspec//
sfatables-rule
/argument[name='blacklist']/value"/>
+ <xsl:variable name="whitelist_prefix" select="//rspec//
rule-context
/argument[name='whitelist']/value"/>
+ <xsl:variable name="blacklist_prefix" select="//rspec//
rule-context
/argument[name='blacklist']/value"/>
<!-- Drop nodes that are not in the whitelist -->
<xsl:template match="node">
<!-- Drop nodes that are not in the whitelist -->
<xsl:template match="node">
@@
-23,3
+23,4
@@
</xsl:template>
</xsl:stylesheet>
</xsl:template>
</xsl:stylesheet>
+et>
diff --git
a/sfatables/test.sfarspec
b/sfatables/test.sfarspec
index
5a3a36b
..
ec9c362
100644
(file)
--- a/
sfatables/test.sfarspec
+++ b/
sfatables/test.sfarspec
@@
-5,6
+5,13
@@
<sfa><user><hrn>plc.princeton.sapanb</hrn></user></sfa>
</request-context>
<sfa><user><hrn>plc.princeton.sapanb</hrn></user></sfa>
</request-context>
+ <rule-context>
+ <argument>
+ <name>blacklist</name>
+ <value>plc.tp</value>
+ </argument>
+ </rule-context>
+
<request>
<nodespec>
<node name="plc.princeton.planetlab-01"/>
<request>
<nodespec>
<node name="plc.princeton.planetlab-01"/>
@@
-15,3
+22,4
@@
</nodespec>
</request>
</rspec>
</nodespec>
</request>
</rspec>
+ec>
diff --git
a/sfatables/xmlrule.py
b/sfatables/xmlrule.py
index
58a8d4c
..
b700b60
100644
(file)
--- a/
sfatables/xmlrule.py
+++ b/
sfatables/xmlrule.py
@@
-42,11
+42,13
@@
class XMLRule:
style = libxslt.parseStylesheetDoc(styledoc)
#doc = libxml2.parseDoc(rspec)
result = style.applyStylesheet(doc, None)
style = libxslt.parseStylesheetDoc(styledoc)
#doc = libxml2.parseDoc(rspec)
result = style.applyStylesheet(doc, None)
- stylesheet_result =
result #
style.saveResultToString(result)
+ stylesheet_result = style.saveResultToString(result)
style.freeStylesheet()
style.freeStylesheet()
-
#
doc.freeDoc()
-
#
result.freeDoc()
+ doc.freeDoc()
+ result.freeDoc()
+ import pdb
+ pdb.set_trace()
return stylesheet_result
def match(self, rspec):
return stylesheet_result
def match(self, rspec):