From dde2b912caa3c9b39531b51d9d4d54eddce5ad00 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Sun, 27 Sep 2009 01:52:12 +0000 Subject: [PATCH 1/1] manually add 'authority' field to the record --- sfa/plc/sfaImport.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sfa/plc/sfaImport.py b/sfa/plc/sfaImport.py index fd8c08b9..e3e78443 100644 --- a/sfa/plc/sfaImport.py +++ b/sfa/plc/sfaImport.py @@ -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) -- 2.43.0