class IotlabMobility(Element):
""" Class to give information of a node's mobility, and what kind of
mobility it is (train, roomba robot ...) """
- fields = ['mobile', 'type']
+ fields = ['mobile', 'mobility-type']
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
node_elem.add_instance('hardware_types', node, fields)
# set mobility
- if attribute is 'mobile':
- node.elem.add_instance('mobile', node['mobile'],
+ if attribute is 'mobility':
+ node_elem.add_instance('mobility', node['mobility'],
IotlabMobility.fields)
-
# set location
if attribute is 'location':
node_elem.add_instance('location', node['location'],
# add granularity of the reservation system
#TODO put the granularity in network instead SA 18/07/12
- if attribute is 'granularity' :
+ if attribute is 'granularity':
granularity = node['granularity']
if granularity:
node_elem.add_instance('granularity',
now='false')
#set position
+ logger.debug("Iotlabv1Node position node_elem %s" % (node_elem))
if attribute is 'position':
node_elem.add_instance('position', node['position'],
IotlabPosition.fields)
+ logger.debug("Iotlabv1Node position node[position] %s "
+ % (node['position']))
## add services
#PGv2Services.add_services(node_elem, node.get('services', []))
# add slivers
#'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
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)