rspec.version.add_nodes take an extra arg to handle Request RSpec
[sfa.git] / sfa / rspecs / elements / versions / iotlabv1Node.py
index af3d0d4..bb1a010 100644 (file)
@@ -69,7 +69,7 @@ class Iotlabv1Node:
         network_elem.set('login', unicode(iotlab_network_dict['login']))
 
     @staticmethod
-    def add_nodes(xml, nodes):
+    def add_nodes(xml, nodes, rspec_content_type=None):
         """Adds the nodes to the xml.
 
         Adds the nodes as well as dedicated iotlab fields to the node xml
@@ -169,6 +169,11 @@ class Iotlabv1Node:
                                                     #'value': initscript['name']})
 
                     Iotlabv1Sliver.add_slivers(node_elem, slivers)
+            
+            # add sliver tag in Request Rspec
+            if rspec_content_type == "request":
+                node_elem.add_instance('sliver', '', [])
+
         return node_elems
 
     @staticmethod
@@ -257,6 +262,12 @@ class Iotlabv1Node:
             node['interfaces'] = [iface_elem.get_instance(Interface)
                                   for iface_elem in iface_elems]
 
+            # get position
+            position_elems = node_elem.xpath('./default:position | ./position')
+            if position_elems:
+                position_elem = position_elems[0]
+                node['position'] = position_elem.get_instance(IotlabPosition)
+
             # get services
             #node['services'] = PGv2Services.get_services(node_elem)