Correction to slab_importer to handle the new node_id type (str instead of int).
authorSandrine Avakian <sandrine.avakian@inria.fr>
Thu, 21 Jun 2012 08:05:38 +0000 (10:05 +0200)
committerSandrine Avakian <sandrine.avakian@inria.fr>
Thu, 21 Jun 2012 08:05:38 +0000 (10:05 +0200)
sfa/importer/slabimporter.py

index 0c772db..624d6f3 100644 (file)
@@ -32,7 +32,7 @@ class SlabImporter:
 
        
     def hostname_to_hrn(self,root_auth,login_base,hostname):
-        return PlXrn(auth=root_auth,hostname=login_base+'_'+hostname).get_hrn()   
+        return PlXrn(auth=root_auth,hostname = hostname).get_hrn()   
     
     def slicename_to_hrn(self, person_hrn):
         return  (person_hrn +'_slice')
@@ -143,7 +143,7 @@ class SlabImporter:
                         urn = hrn_to_urn(hrn, 'node') 
                         node_gid = self.auth_hierarchy.create_gid(urn, create_uuid(), pkey)
                         node_record = RegNode (hrn=hrn, gid=node_gid, 
-                                                pointer =node['node_id'],
+                                                pointer = '-1',
                                                 authority=get_authority(hrn))
                         node_record.just_created()
                         dbsession.add(node_record)
@@ -171,7 +171,8 @@ class SlabImporter:
     
                 user_record = self.find_record_by_type_hrn( 'user', person_hrn)
                 slice_record = self.find_record_by_type_hrn ('slice', slice_hrn)
-                print>>sys.stderr, "\r\n \r\n SLAB IMPORTER FROM LDAP LIST PERSON IMPORT user_record %s " %(user_record)
+               
+                print>>sys.stderr, "\r\n \r\n SLAB IMPORTER FROM LDAP LIST PERSON IMPORT person_hrn %s user_record %s person['pkey'] %s" %(person_hrn, user_record,person['pkey'])
                 
                 
                 # return a tuple pubkey (a plc key object) and pkey (a Keypair object)