magic for debugging in make
[sfa.git] / sfa / importer / iotlabimporter.py
index 17891cf..3528db4 100644 (file)
@@ -1,6 +1,6 @@
 """ File defining the importer class and all the methods needed to import
 the nodes, users and slices from OAR and LDAP to the SFA database.
 """ File defining the importer class and all the methods needed to import
 the nodes, users and slices from OAR and LDAP to the SFA database.
-Also creates the iotlab specific databse and table to keep track
+Also creates the iotlab specific  table to keep track
 of which slice hrn contains which job.
 """
 from sfa.util.config import Config
 of which slice hrn contains which job.
 """
 from sfa.util.config import Config
@@ -145,18 +145,17 @@ class IotlabImporter:
 
     def locate_by_type_pointer(self, record_type, pointer):
         """
 
     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 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
             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)
 
         """
         return self.records_by_type_pointer.get((record_type, pointer), None)
 
@@ -222,7 +221,7 @@ class IotlabImporter:
                 node_gid = \
                     self.auth_hierarchy.create_gid(urn, create_uuid(), pkey)
 
                 node_gid = \
                     self.auth_hierarchy.create_gid(urn, create_uuid(), pkey)
 
-                def iotlab_get_authority(hrn):
+                def testbed_get_authority(hrn):
                     """ Gets the authority part in the hrn.
                     :param hrn: hrn whose authority we are looking for.
                     :type hrn: string
                     """ Gets the authority part in the hrn.
                     :param hrn: hrn whose authority we are looking for.
                     :type hrn: string
@@ -235,7 +234,7 @@ class IotlabImporter:
 
                 node_record = RegNode(hrn=hrn, gid=node_gid,
                                       pointer='-1',
 
                 node_record = RegNode(hrn=hrn, gid=node_gid,
                                       pointer='-1',
-                                      authority=iotlab_get_authority(hrn))
+                                      authority=testbed_get_authority(hrn))
                 try:
 
                     node_record.just_created()
                 try:
 
                     node_record.just_created()
@@ -310,15 +309,14 @@ class IotlabImporter:
 
     def init_person_key(self, person, iotlab_key):
         """
 
     def init_person_key(self, person, iotlab_key):
         """
-
         Returns a tuple pubkey and pkey.
 
         :param person Person's data.
         :type person: dict
         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
         :type iotlab_key: string
-        :rtype (string, Keypair)
+        :rtype: (string, Keypair)
 
         """
         pubkey = None
 
         """
         pubkey = None
@@ -531,7 +529,7 @@ class IotlabImporter:
 
     def run(self, options):
         """
 
     def run(self, options):
         """
-        Create the special iotlab table, lease_table, in the iotlab database.
+        Create the special iotlab table, lease_table, in the SFA database.
         Import everything (users, slices, nodes and sites from OAR
         and LDAP) into the SFA database.
         Delete stale records that are no longer in OAR or LDAP.
         Import everything (users, slices, nodes and sites from OAR
         and LDAP) into the SFA database.
         Delete stale records that are no longer in OAR or LDAP.