From: Tony Mack Date: Fri, 16 Oct 2009 21:11:46 +0000 (+0000) Subject: import_site() returns the site hrn X-Git-Tag: sfa-0.9-6~162 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=502005ad3546e5b0df7df6156b669966c8ce599c;p=sfa.git import_site() returns the site hrn --- diff --git a/sfa/plc/sfa-import-plc.py b/sfa/plc/sfa-import-plc.py index 7b0685e1..8e0b3086 100755 --- a/sfa/plc/sfa-import-plc.py +++ b/sfa/plc/sfa-import-plc.py @@ -157,7 +157,7 @@ def main(): # but its not a site record if site_hrn not in existing_hrns or \ (site_hrn, 'authority') not in existing_records: - sfaImporter.import_site(import_auth, site) + site_hrn = sfaImporter.import_site(import_auth, site) # import node records for node_id in site['node_ids']: diff --git a/sfa/plc/sfaImport.py b/sfa/plc/sfaImport.py index f429ceeb..a2ae5e04 100644 --- a/sfa/plc/sfaImport.py +++ b/sfa/plc/sfaImport.py @@ -210,11 +210,11 @@ class sfaImport: # sites only if ".vini" in parent_hrn and parent_hrn.endswith('vini'): if sitename.startswith("ii"): - sitename = sitename.replace("ii", "") + #sitename = sitename.replace("ii", "") hrn = ".".join([parent_hrn, "internet2", sitename]) elif sitename.startswith("nlr"): + #sitename = sitename.replace("nlr", "") hrn = ".".join([parent_hrn, "internet2", sitename]) - sitename = sitename.replace("nlr", "") trace("Import_Site: importing site " + hrn) @@ -236,6 +236,8 @@ class sfaImport: auth_record['record_id'] = existing_record['record_id'] table.update(auth_record) + return hrn + def delete_record(self, hrn, type): # delete the record