From df152f6a6b06a8272aa5b703ba47b524f5755fc1 Mon Sep 17 00:00:00 2001
From: Tony Mack <tmack@paris.CS.Princeton.EDU>
Date: Wed, 4 Jan 2012 14:20:27 -0500
Subject: [PATCH] set the 'authority' field when importing sites

---
 sfa/importer/sfa-import-plc.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sfa/importer/sfa-import-plc.py b/sfa/importer/sfa-import-plc.py
index b44de5fd..723f473f 100755
--- a/sfa/importer/sfa-import-plc.py
+++ b/sfa/importer/sfa-import-plc.py
@@ -144,7 +144,9 @@ def main():
             if not sfaImporter.AuthHierarchy.auth_exists(urn):
                 sfaImporter.AuthHierarchy.create_auth(urn)
             auth_info = sfaImporter.AuthHierarchy.get_auth_info(urn)
-            auth_record = SfaRecord(hrn=site_hrn, gid=auth_info.get_gid_object(), type="authority", pointer=site['site_id'])
+            auth_record = SfaRecord(hrn=site_hrn, gid=auth_info.get_gid_object(), \
+                                    type="authority", pointer=site['site_id'], 
+                                    authority=get_authority(site_hrn))
             auth_record.sync(verbose=True)
 
     # start importing 
@@ -163,7 +165,8 @@ def main():
                     sfaImporter.AuthHierarchy.create_auth(urn)
                 auth_info = sfaImporter.AuthHierarchy.get_auth_info(urn)
                 auth_record = SfaRecord(hrn=site_hrn, gid=auth_info.get_gid_object(), \
-                                        type="authority", pointer=site['site_id'])
+                                        type="authority", pointer=site['site_id'], 
+                                        authority=get_authority(site_hrn))
                 logger.info("Import: importing site: %s" % auth_record.summary_string())  
                 auth_record.sync()
             except:
-- 
2.47.0