changing mobility-type to mobility_type
[sfa.git] / sfa / iotlab / OARrestapi.py
index c5e714d..d0fc864 100644 (file)
@@ -307,6 +307,7 @@ class ParsingResourcesFull():
         'archi': self.AddHardwareType,
         'state': self.AddBootState,
         'id': self.AddOarNodeId,
+        'mobility_type': self.AddMobilityType,
         }
 
 
@@ -380,14 +381,25 @@ class ParsingResourcesFull():
     #     """
     #     tuplelist.append(('radio', str(value)))
 
+    def AddMobilityType(self, tuplelist, value):
+        """Adds  which kind of mobility it is, train or roomba robot.
+
+        :param tuplelist: tuple list on which to add the node's mobility status.
+            The tuplelist is the value associated with the node's id in the
+            OARGETParser's dictionary node_dictlist.
+        :param value: tells if a node is a mobile node or not. The value is
+            found in the json.
+
+        :type tuplelist: list
+        :type value: integer
+
+        """
+        tuplelist.append(('mobility_type', str(value)))
+
 
     def AddMobility(self, tuplelist, value):
         """Add if the node is a mobile node or not to the tuple list.
 
-        will also add which kind of mobility it is if the information
-        is available, supposing the information is formatted as a string
-        with the 2 information separated by a colon.
-
         :param tuplelist: tuple list on which to add the node's mobility status.
             The tuplelist is the value associated with the node's id in the
             OARGETParser's dictionary node_dictlist.
@@ -401,13 +413,6 @@ class ParsingResourcesFull():
 
         """
         # future support of mobility type
-        if ":" in value:
-            value_list = value.split(':')
-            if value_list[0] is 0:
-                tuplelist.append(('mobile', 'False'))
-            else:
-               tuplelist.append(('mobile', 'True'))
-            tuplelist.append(('type', value_list[1]))
 
         if value is 0:
             tuplelist.append(('mobile', 'False'))