Documenting and cleaning test scripts in /testbeds/iotlab/tests.
[sfa.git] / sfa / importer / iotlabimporter.py
index c29457c..9c957b3 100644 (file)
@@ -71,7 +71,7 @@ class IotlabImporter:
 
 
 
-    def exists(self, tablename, engine):
+    def exists(self, tablename):
         """
         Checks if the table specified as tablename exists.
         :param tablename: name of the table in the db that has to be checked.
@@ -145,18 +145,17 @@ class IotlabImporter:
 
     def locate_by_type_pointer(self, record_type, pointer):
         """
-
-        Returns the record corresponding to the key pointer and record
-        type. Returns None if the record does not exist and is not in the
-        records_by_type_pointer dictionnary.
+        Returns the record corresponding to the key pointer and record type.
+            Returns None if the record does not exist and is not in the
+            records_by_type_pointer dictionnary.
 
         :param record_type: the record's type (slice, node, authority...)
         :type  record_type: string
-        :param pointer:Pointer to where the record is in the origin db,
+        :param pointer: Pointer to where the record is in the origin db,
             used in case the record comes from a trusted authority.
         :type pointer: integer
-        :rtype: RegUser if user, RegSlice if slice, RegNode if node...
-            or None if record does not exist.
+        :rtype: RegUser if user, RegSlice if slice, RegNode if node, or None if
+            record does not exist.
         """
         return self.records_by_type_pointer.get((record_type, pointer), None)
 
@@ -310,15 +309,14 @@ class IotlabImporter:
 
     def init_person_key(self, person, iotlab_key):
         """
-
         Returns a tuple pubkey and pkey.
 
         :param person Person's data.
         :type person: dict
-        :param iotlab_key: SSH public key, from LDAP user's data.
-            RSA type supported.
+        :param iotlab_key: SSH public key, from LDAP user's data. RSA type
+            supported.
         :type iotlab_key: string
-        :rtype (string, Keypair)
+        :rtype: (string, Keypair)
 
         """
         pubkey = None
@@ -518,11 +516,9 @@ class IotlabImporter:
         #No slice update upon import in iotlab
         else:
             # xxx update the record ...
-            self.logger.warning("Slice update not yet implemented")
-            pass
-        # record current users affiliated with the slice
-
+            self.logger.warning("Iotlab Slice update not implemented")
 
+        # record current users affiliated with the slice
         slice_record.reg_researchers = [user_record]
         try:
             global_dbsession.commit()
@@ -549,7 +545,7 @@ class IotlabImporter:
         # leases_db = TestbedAdditionalSfaDB(config)
         #Create special slice table for iotlab
 
-        if not self.exists('lease_table', engine):
+        if not self.exists('lease_table'):
             init_tables(engine)
             self.logger.info("IotlabImporter.run:  lease_table table created ")