Ejemplo n.º 1
0
    def __init__(self):
        super(MeteringPlugin, self).__init__()

        self.meter_rpc = metering_rpc_agent_api.MeteringAgentNotifyAPI()
        rpc_worker = service.RpcWorker([self], worker_process_count=0)

        self.add_worker(rpc_worker)
Ejemplo n.º 2
0
 def __init__(self):
     """Do the initialization for the ecmp service plugin here."""
     LOG.info("Initializing ECMP plugin")
     self.agent_rpc = EcmpAgentApi(ECMP_AGENT, cfg.CONF.host)
     ecmp_db.subscribe()
     rpc_worker = service.RpcWorker([self], worker_process_count=0)
     self.add_worker(rpc_worker)
Ejemplo n.º 3
0
    def __init__(self):
        super(FirewallPluginV2, self).__init__()
        """Do the initialization for the firewall service plugin here."""
        # Initialize the Firewall v2 service plugin
        service_type_manager = st_db.ServiceTypeManager.get_instance()
        service_type_manager.add_provider_configuration(
            fwaas_constants.FIREWALL_V2,
            provider_conf.ProviderConfiguration('neutron_fwaas'))

        # Load the default driver
        drivers, default_provider = service_base.load_drivers(
            fwaas_constants.FIREWALL_V2, self)
        LOG.info("Firewall v2 Service Plugin using Service Driver: %s",
                 default_provider)

        if len(drivers) > 1:
            LOG.warning("Multiple drivers configured for Firewall v2, "
                        "although running multiple drivers in parallel is "
                        "not yet supported")

        self.driver = drivers[default_provider]

        # start rpc listener if driver required
        if isinstance(self.driver, driver_api.FirewallDriverRPCMixin):
            rpc_worker = service.RpcWorker([self], worker_process_count=0)
            self.add_worker(rpc_worker)
Ejemplo n.º 4
0
    def __init__(self):
        """Do the initialization for the firewall service plugin here."""

        self.agent_rpc = FirewallAgentApi(f_const.FW_AGENT, cfg.CONF.host)
        firewall_db.subscribe()

        rpc_worker = service.RpcWorker([self], worker_process_count=0)
        self.add_worker(rpc_worker)
Ejemplo n.º 5
0
    def __init__(self):
        self.router_scheduler = importutils.import_object(
            cfg.CONF.router_scheduler_driver)
        self.add_periodic_l3_agent_status_check()
        super(L3RouterPlugin, self).__init__()
        if 'dvr' in self.supported_extension_aliases:
            l3_dvrscheduler_db.subscribe()
        self.agent_notifiers.update(
            {n_const.AGENT_TYPE_L3: l3_rpc_agent_api.L3AgentNotifyAPI()})

        rpc_worker = service.RpcWorker([self], worker_process_count=0)

        self.add_worker(rpc_worker)
        self.l3_driver_controller = driver_controller.DriverController(self)
Ejemplo n.º 6
0
    def serve_rpc(self):
        """Launches configured # of workers per loaded plugin."""
        if cfg.CONF.QUARK_ASYNC.rpc_workers < 1:
            cfg.CONF.set_override('rpc_workers', 1, "QUARK_ASYNC")

        try:
            rpc = service.RpcWorker(self.plugins)
            launcher = common_service.ProcessLauncher(CONF, wait_interval=1.0)
            launcher.launch_service(rpc, workers=CONF.QUARK_ASYNC.rpc_workers)

            return launcher
        except Exception:
            with excutils.save_and_reraise_exception():
                LOG.exception(_LE('Unrecoverable error: please check log for '
                                  'details.'))
Ejemplo n.º 7
0
 def test_reset(self):
     _plugin = mock.Mock()
     rpc_worker = service.RpcWorker(_plugin)
     self._test_reset(rpc_worker)
Ejemplo n.º 8
0
 def get_workers(self):
     return [service.RpcWorker([self], worker_process_count=0)]
Ejemplo n.º 9
0
 def get_workers(self):
     # NOTE(alegacy): Run this RPC handler is a thread separate from the
     # other server RPC handlers to make sure that any long queries do
     # not slow down other RPC requests.
     return [service.RpcWorker([self], worker_process_count=0)]