rspec.version.add_nodes take an extra arg to handle Request RSpec
[sfa.git] / sfa / rspecs / elements / versions / pgv2Node.py
index ee69f03..0a694ad 100644 (file)
@@ -19,7 +19,7 @@ from sfa.rspecs.elements.attribute import Attribute
 
 class PGv2Node:
     @staticmethod
-    def add_nodes(xml, nodes):
+    def add_nodes(xml, nodes, rspec_content_type=None):
         node_elems = []
         for node in nodes:
             node_fields = ['component_manager_id', 'component_id', 'client_id', 'sliver_id', 'exclusive']
@@ -70,6 +70,10 @@ class PGv2Node:
                     tag['name'] = tag.pop('tagname')
                     node_elem.add_instance('{%s}attribute' % xml.namespaces['planetlab'], tag, ['name', 'value'])
 
+            # add sliver tag in Request Rspec
+            if rspec_content_type == "request":
+                node_elem.add_instance('sliver', '', [])
+
         return node_elems