X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fplc%2FsfaImport.py;h=f429ceeb1f1fabf99181f006b2e4d0906570d447;hb=4b2e86d099a60df5fb6b9732c080a3d10512c029;hp=fd8c08b92e8973da1a4784652515d5670b96ded9;hpb=360779d7a069ccccf753ed8d55c09576f486d5c0;p=sfa.git diff --git a/sfa/plc/sfaImport.py b/sfa/plc/sfaImport.py index fd8c08b9..f429ceeb 100644 --- a/sfa/plc/sfaImport.py +++ b/sfa/plc/sfaImport.py @@ -52,9 +52,8 @@ class sfaImport: def __init__(self): self.AuthHierarchy = Hierarchy() - self.TrustedRoots = TrustedRootList() - self.config = Config() + self.TrustedRoots = TrustedRootList(Config.get_trustedroots_dir(self.config)) self.plc_auth = self.config.get_plc_auth() self.root_auth = self.config.SFA_REGISTRY_ROOT_AUTH self.level1_auth = self.config.SFA_REGISTRY_LEVEL1_AUTH @@ -95,6 +94,7 @@ class sfaImport: if not auth_record: auth_record = GeniRecord(hrn=hrn, gid=auth_info.get_gid_object(), type="authority", pointer=-1) + auth_record['authority'] = get_authority(auth_record['hrn']) trace(" inserting authority record for " + hrn) table.insert(auth_record) @@ -129,6 +129,7 @@ class sfaImport: person_gid = AuthHierarchy.create_gid(hrn, create_uuid(), pkey) table = GeniTable() person_record = GeniRecord(hrn=hrn, gid=person_gid, type="user", pointer=person['person_id']) + person_record['authority'] = get_authority(person_record['hrn']) existing_records = table.find({'hrn': hrn, 'type': 'user', 'pointer': person['person_id']}) if not existing_records: table.insert(person_record) @@ -153,6 +154,7 @@ class sfaImport: pkey = Keypair(create=True) slice_gid = AuthHierarchy.create_gid(hrn, create_uuid(), pkey) slice_record = GeniRecord(hrn=hrn, gid=slice_gid, type="slice", pointer=slice['slice_id']) + slice_record['authority'] = get_authority(slice_record['hrn']) table = GeniTable() existing_records = table.find({'hrn': hrn, 'type': 'slice', 'pointer': slice['slice_id']}) if not existing_records: @@ -183,6 +185,7 @@ class sfaImport: pkey = Keypair(create=True) node_gid = AuthHierarchy.create_gid(hrn, create_uuid(), pkey) node_record = GeniRecord(hrn=hrn, gid=node_gid, type="node", pointer=node['node_id']) + node_record['authority'] = get_authority(node_record['hrn']) existing_records = table.find({'hrn': hrn, 'type': 'node', 'pointer': node['node_id']}) if not existing_records: table.insert(node_record) @@ -223,6 +226,7 @@ class sfaImport: table = GeniTable() auth_record = GeniRecord(hrn=hrn, gid=auth_info.get_gid_object(), type="authority", pointer=site['site_id']) + auth_record['authority'] = get_authority(auth_record['hrn']) existing_records = table.find({'hrn': hrn, 'type': 'authority', 'pointer': site['site_id']}) if not existing_records: table.insert(auth_record)