From: Nicolas Turro Date: Wed, 16 Nov 2011 14:39:08 +0000 (+0100) Subject: Gid creation code moved. NT. X-Git-Tag: sfa-2.1-24~3^2~280^2 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=e2adde340d3c1678329d69faa511d5a72fb31ccc Gid creation code moved. NT. --- diff --git a/sfa/senslab/LDAPapi.py b/sfa/senslab/LDAPapi.py index fed0ac36..87c17754 100644 --- a/sfa/senslab/LDAPapi.py +++ b/sfa/senslab/LDAPapi.py @@ -61,30 +61,28 @@ class LDAPapi : ldapresponse=self.ldapserv.result(rindex,1) for ldapentry in ldapresponse[1]: hrn=self.authname+"."+ldapentry[1]['uid'][0] - uuid=create_uuid() +# uuid=create_uuid() - RSA_KEY_STRING=ldapentry[1]['sshPublicKey'][0] +# RSA_KEY_STRING=ldapentry[1]['sshPublicKey'][0] - pkey=convert_public_key(RSA_KEY_STRING) +# pkey=convert_public_key(RSA_KEY_STRING) - gid=self.senslabauth.create_gid("urn:publicid:IDN+"+self.authname+"+user+"+ldapentry[1]['uid'][0], uuid, pkey, CA=False) +# gid=self.senslabauth.create_gid("urn:publicid:IDN+"+self.authname+"+user+"+ldapentry[1]['uid'][0], uuid, pkey, CA=False) parent_hrn = get_authority(hrn) parent_auth_info = self.senslabauth.get_auth_info(parent_hrn) results.append( { 'type': 'user', + 'pkey': ldapentry[1]['sshPublicKey'][0]. # 'email': ldapentry[1]['mail'][0], # 'first_name': ldapentry[1]['givenName'][0], # 'last_name': ldapentry[1]['sn'][0], # 'phone': 'none', - 'gid': gid.save_to_string(), 'serial': 'none', 'authority': self.authname, 'peer_authority': '', 'pointer' : -1, 'hrn': hrn, - 'date_created' : 'none', - 'last_updated': 'none' } ) return results diff --git a/sfa/senslab/slab-import.py b/sfa/senslab/slab-import.py index e41e2ca4..1cfbda10 100644 --- a/sfa/senslab/slab-import.py +++ b/sfa/senslab/slab-import.py @@ -80,10 +80,15 @@ def import_person(person): existing_records = table.find({'hrn': person['hrn'], 'type': 'user'}) if not existing_records: print>>sys.stderr, " \r\n \t slab-import : person record %s inserted" %(person['hrn']) + uuid=create_uuid() + RSA_KEY_STRING=person['pkey'] + pkey=convert_public_key(RSA_KEY_STRING) + person['gid']=self.senslabauth.create_gid("urn:publicid:IDN+"+self.authname+"+user+"+ldapentry[1]['uid'][0], uuid, pkey, CA=False) table.insert(person) else: existing_record = existing_records[0] person['record_id'] = existing_record['record_id'] + # handle key change ??? table.update(person) def import_slice(person):