From: Sandrine Avakian Date: Tue, 8 Oct 2013 11:48:59 +0000 (+0200) Subject: changing mobility-type to mobility_type X-Git-Tag: sfa-2.1-27~8^2~1 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=59efd21588743e444a9f253411375615dd064b0f changing mobility-type to mobility_type --- diff --git a/sfa/iotlab/OARrestapi.py b/sfa/iotlab/OARrestapi.py index 40aad500..d0fc8648 100644 --- a/sfa/iotlab/OARrestapi.py +++ b/sfa/iotlab/OARrestapi.py @@ -307,6 +307,7 @@ class ParsingResourcesFull(): 'archi': self.AddHardwareType, 'state': self.AddBootState, 'id': self.AddOarNodeId, + 'mobility_type': self.AddMobilityType, } @@ -393,7 +394,7 @@ class ParsingResourcesFull(): :type value: integer """ - tuplelist.append(('mobility-type', str(value))) + tuplelist.append(('mobility_type', str(value))) def AddMobility(self, tuplelist, value): diff --git a/sfa/iotlab/iotlabaggregate.py b/sfa/iotlab/iotlabaggregate.py index 474aadae..4ea6a815 100644 --- a/sfa/iotlab/iotlabaggregate.py +++ b/sfa/iotlab/iotlabaggregate.py @@ -103,8 +103,8 @@ class IotlabAggregate: login=login) logger.debug("IotlabAggregate api \tget_slice_and_slivers \ - sfa_slice %s \r\n slices %s self.driver.hrn %s" - % (sfa_slice, slices, self.driver.hrn)) + slice_hrn %s \r\n slices %s self.driver.hrn %s" + % (slice_hrn, slices, self.driver.hrn)) if slices == []: return (sfa_slice, slivers) @@ -117,6 +117,7 @@ class IotlabAggregate: logger.log_exc("IOTLABAGGREGATE \t \ get_slice_and_slivers No nodes in the slice \ - KeyError ") + node_ids_list = [] continue for node in node_ids_list: diff --git a/sfa/rspecs/elements/versions/iotlabv1Node.py b/sfa/rspecs/elements/versions/iotlabv1Node.py index 6a95d238..d95103a0 100644 --- a/sfa/rspecs/elements/versions/iotlabv1Node.py +++ b/sfa/rspecs/elements/versions/iotlabv1Node.py @@ -39,7 +39,7 @@ class IotlabLocation(Location): class IotlabMobility(Element): """ Class to give information of a node's mobility, and what kind of mobility it is (train, roomba robot ...) """ - fields = ['mobile', 'mobility-type'] + fields = ['mobile', 'mobility_type'] @@ -58,15 +58,15 @@ class Iotlabv1Node: if len(network_elems) > 0: network_elem = network_elems[0] - iotlab_network_dict = {} - iotlab_network_dict['login'] = ldap_username + iotlab_network_dict = {} + iotlab_network_dict['login'] = ldap_username - iotlab_network_dict['ssh'] = \ - ['ssh ' + ldap_username + '@'+site+'.iotlab.info' - for site in sites_set] - network_elem.set('ssh', - unicode(iotlab_network_dict['ssh'])) - network_elem.set('login', unicode(iotlab_network_dict['login'])) + iotlab_network_dict['ssh'] = \ + ['ssh ' + ldap_username + '@'+site+'.iotlab.info' + for site in sites_set] + network_elem.set('ssh', + unicode(iotlab_network_dict['ssh'])) + network_elem.set('login', unicode(iotlab_network_dict['login'])) @staticmethod def add_nodes(xml, nodes): @@ -94,7 +94,6 @@ class Iotlabv1Node: else: network_elem = xml - logger.debug("iotlabv1Node \t add_nodes nodes %s \r\n " % (nodes[0])) node_elems = [] #Then add nodes items to the network item in the xml for node in nodes: @@ -147,12 +146,9 @@ class Iotlabv1Node: 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