From: Tony Mack Date: Wed, 4 Jan 2012 19:20:27 +0000 (-0500) Subject: set the 'authority' field when importing sites X-Git-Tag: sfa-2.0-8~2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=df152f6a6b06a8272aa5b703ba47b524f5755fc1;p=sfa.git set the 'authority' field when importing sites --- 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: