Fixed problem inserting ldap user into sfa table.
authorSandrine Avakian <sandrine.avakian@inria.fr>
Tue, 15 Nov 2011 15:32:16 +0000 (16:32 +0100)
committerSandrine Avakian <sandrine.avakian@inria.fr>
Tue, 15 Nov 2011 15:32:16 +0000 (16:32 +0100)
sfa/senslab/LDAPapi.py
sfa/senslab/slab-import.py

index fbc14ec..fed0ac3 100644 (file)
@@ -82,7 +82,7 @@ class LDAPapi :
                                'serial': 'none',
                                'authority': self.authname,
                                'peer_authority': '',
-                               'pointer' : '',
+                               'pointer' : -1,
                                'hrn': hrn,
                                'date_created' : 'none',
                                'last_updated': 'none'
index c10a91f..94052ca 100644 (file)
@@ -141,8 +141,7 @@ def main():
     #print "\r\n NODES8DICT ",nodes_dict
     
     ldap_person_list = Driver.GetPersons()
-    print "\r\n PERSONS_LIST ",ldap_person_list
-
+    
    
     
     #slices_list = SenslabUsers.GetSlices()
@@ -196,7 +195,9 @@ def main():
                                        
     # remove stale records    
     system_records = [interface_hrn, root_auth, interface_hrn + '.slicemanager']
+
     for (record_hrn, type) in existing_records.keys():
+        #print " \r\n EXISTING RECORDS " , (record_hrn, type)
         if record_hrn in system_records:
             continue
         
@@ -218,10 +219,10 @@ def main():
             break
                 
         elif type == 'user':
-            for person in persons:
+            for person in ldap_person_list:
                 if person['hrn'] == record_hrn:
                     found = True
-                break
+                    break
             
         elif type == 'node':
             login_base = get_leaf(get_authority(record_hrn))
@@ -237,8 +238,8 @@ def main():
         
         if not found:
             record_object = existing_records[(record_hrn, type)]
-            print "\t\t NOT FOUND ! "
+            print "\t\t  NOT FOUND ! ", record_hrn
             delete_record(record_hrn, type) 
     
 if __name__ == "__main__":
-    main()    
\ No newline at end of file
+    main()