X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fimporter%2FsfaImport.py;h=a9d6bd7cba6da278e9e805ea817987635af79134;hb=d36ed91b6c8edecdc0da28daf2baf5abca7cafc3;hp=8d09b81b4becee9a662dfaad056275ac89a43436;hpb=138a4a5ff8e59d53694d84d28eb67ebcc83c53a6;p=sfa.git diff --git a/sfa/importer/sfaImport.py b/sfa/importer/sfaImport.py index 8d09b81b..a9d6bd7c 100644 --- a/sfa/importer/sfaImport.py +++ b/sfa/importer/sfaImport.py @@ -17,7 +17,6 @@ from sfa.trust.trustedroots import TrustedRoots from sfa.trust.hierarchy import Hierarchy from sfa.trust.gid import create_uuid from sfa.storage.persistentobjs import RegRecord, RegAuthority, RegUser -from sfa.storage.persistentobjs import RegAuthoritySa, RegAuthorityAm, RegAuthoritySm from sfa.storage.alchemy import dbsession def _un_unicode(str): @@ -92,6 +91,7 @@ class sfaImport: # create the db record if it doesnt already exist auth_info = self.AuthHierarchy.get_auth_info(hrn) auth_record = RegAuthority() + auth_record.type='authority' auth_record.hrn=hrn auth_record.gid=auth_info.get_gid_object() auth_record.authority=get_authority(hrn) @@ -112,6 +112,7 @@ class sfaImport: auth_info = self.AuthHierarchy.get_auth_info(hrn) user_record = RegUser() + user_record.type='user' user_record.hrn=hrn user_record.gid=auth_info.get_gid_object() user_record.authority=get_authority(hrn) @@ -127,17 +128,15 @@ class sfaImport: # just create certs for all sfa interfaces even if they # aren't enabled hrn = self.config.SFA_INTERFACE_HRN - reg_classes_info = [ (RegAuthoritySa, 'authority+sa'), - (RegAuthorityAm, 'authority+am'), - (RegAuthoritySm, 'authority+sm'), ] auth_info = self.AuthHierarchy.get_auth_info(hrn) pkey = auth_info.get_pkey_object() - for (reg_class, type) in reg_classes_info: + for type in [ 'authority+sa', 'authority+am', 'authority+sm', ]: urn = hrn_to_urn(hrn, type) gid = self.AuthHierarchy.create_gid(urn, create_uuid(), pkey) # xxx this should probably use a RegAuthority, or a to-be-defined RegPeer object # but for now we have to preserve the authority+<> stuff - interface_record = reg_class() + interface_record = RegAuthority() + interface_record.type=type interface_record.hrn=hrn interface_record.gid= gid interface_record.authority=get_authority(hrn)