- if not level1_auth or level1_auth in ['']:
- level1_auth = None
-
- print "Import: creating top level authorities"
- if not level1_auth:
- sfaImporter.create_top_level_auth_records(root_auth)
- import_auth = root_auth
- else:
- if not AuthHierarchy.auth_exists(level1_auth):
- AuthHierarchy.create_auth(level1_auth)
- sfaImporter.create_top_level_auth_records(level1_auth)
- import_auth = level1_auth
-
- print "Import: adding", import_auth, "to trusted list"
- authority = AuthHierarchy.get_auth_info(import_auth)
- TrustedRoots.add_gid(authority.get_gid_object())
-
- if ".vini" in import_auth and import_auth.endswith('vini'):
+ # create root authority
+ sfaImporter.create_top_level_auth_records(root_auth)
+ if not root_auth == interface_hrn:
+ sfaImporter.create_top_level_auth_records(interface_hrn)
+
+ # create interface records
+ sfaImporter.logger.info("Import: creating interface records")
+ sfaImporter.create_interface_records()
+
+ # add local root authority's cert to trusted list
+ sfaImporter.logger.info("Import: adding " + interface_hrn + " to trusted list")
+ authority = sfaImporter.AuthHierarchy.get_auth_info(interface_hrn)
+ sfaImporter.TrustedRoots.add_gid(authority.get_gid_object())
+
+ # special case for vini
+ if ".vini" in interface_hrn and interface_hrn.endswith('vini'):