+ # this makes the run method a bit abtruse - out of the way
+ def create_special_vini_record (self, interface_hrn):
+ # special case for vini
+ if ".vini" in interface_hrn and interface_hrn.endswith('vini'):
+ # create a fake internet2 site first
+ i2site = {'name': 'Internet2', 'login_base': 'internet2', 'site_id': -1}
+ site_hrn = _get_site_hrn(interface_hrn, i2site)
+ # import if hrn is not in list of existing hrns or if the hrn exists
+ # but its not a site record
+ if ( 'authority', site_hrn, ) not in self.records_by_type_hrn:
+ urn = hrn_to_urn(site_hrn, 'authority')
+ if not self.auth_hierarchy.auth_exists(urn):
+ self.auth_hierarchy.create_auth(urn)
+ auth_info = self.auth_hierarchy.get_auth_info(urn)
+ auth_record = RegAuthority(hrn=site_hrn, gid=auth_info.get_gid_object(),
+ pointer=site['site_id'],
+ authority=get_authority(site_hrn))
+ auth_record.just_created()
+ dbsession.add(auth_record)
+ dbsession.commit()
+ self.logger.info("PlImporter: Imported authority (vini site) %s"%auth_record)
+