+def init_server(options, config):
+ """
+ Execute the init method defined in the manager file
+ """
+ manager_base = 'sfa.managers'
+ if options.registry:
+ mgr_type = config.SFA_REGISTRY_TYPE
+ manager_module = manager_base + ".registry_manager_%s" % mgr_type
+ try: manager = __import__(manager_module, fromlist=[manager_base])
+ except: manager = None
+ if manager and hasattr(manager, 'init_server'):
+ manager.init_server()
+ if options.am:
+ mgr_type = config.SFA_AGGREGATE_TYPE
+ manager_module = manager_base + ".aggregate_manager_%s" % mgr_type
+ try: manager = __import__(manager_module, fromlist=[manager_base])
+ except: manager = None
+ if manager and hasattr(manager, 'init_server'):
+ manager.init_server()
+ if options.sm:
+ mgr_type = config.SFA_SM_TYPE
+ manager_module = manager_base + ".slice_manager_%s" % mgr_type
+ try: manager = __import__(manager_module, fromlist=[manager_base])
+ except: manager = None
+ if manager and hasattr(manager, 'init_server'):
+ manager.init_server()
+ if options.cm:
+ mgr_type = config.SFA_CM_TYPE
+ manager_module = manager_base + ".component_manager_%s" % mgr_type
+ try: manager = __import__(manager_module, fromlist=[manager_base])
+ except: manager = None
+ if manager and hasattr(manager, 'init_server'):
+ manager.init_server()
+
+def sync_interfaces(server_key_file, server_cert_file):
+ """
+ Attempt to install missing trusted gids and db records for
+ our federated interfaces
+ """
+ api = SfaAPI(key_file = server_key_file, cert_file = server_cert_file)
+ registries = Registries(api)
+ aggregates = Aggregates(api)
+ registries.sync_interfaces()
+ aggregates.sync_interfaces()