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):
        super(MeteringPlugin, self).__init__()

        self.endpoints = [metering_rpc.MeteringRpcCallbacks(self)]

        self.conn = n_rpc.create_connection(new=True)
        self.conn.create_consumer(
            topics.METERING_PLUGIN, self.endpoints, fanout=False)
        self.conn.consume_in_threads()

        self.meter_rpc = metering_rpc_agent_api.MeteringAgentNotifyAPI()
Ejemplo n.º 3
0
    def __init__(self):
        super(MeteringPlugin, self).__init__()

        self.callbacks = MeteringCallbacks(self)

        self.conn = rpc.create_connection(new=True)
        self.conn.create_consumer(topics.METERING_PLUGIN,
                                  self.callbacks.create_rpc_dispatcher(),
                                  fanout=False)
        self.conn.consume_in_thread()

        self.meter_rpc = metering_rpc_agent_api.MeteringAgentNotifyAPI()
Ejemplo n.º 4
0
 def test_routers_updated_on_host_rpc_call(self):
     router_test = {'id': 'xyz', 'name': 'testrouter'}
     notify_host = ('neutron.api.rpc.agentnotifiers.' +
                    'metering_rpc_agent_api.MeteringAgentNotifyAPI' +
                    '._notification_host')
     self.notify_patch = mock.patch(notify_host)
     self.mock_notify_host = self.notify_patch.start()
     metering_rpc_handle = metering_rpc_agent_api.MeteringAgentNotifyAPI()
     metering_rpc_handle.routers_updated_on_host(self.ctx,
                                                 [router_test['id']],
                                                 'test_host')
     self.mock_notify_host.assert_called_with(self.ctx,
                                              'routers_updated',
                                              'test_host',
                                              routers=['xyz'])
Ejemplo n.º 5
0
    def __init__(self):
        dbapi.register_models()

        self.meter_rpc = metering_rpc_agent_api.MeteringAgentNotifyAPI()
Ejemplo n.º 6
0
 def __init__(self):
     self.meter_rpc = metering_rpc_agent_api.MeteringAgentNotifyAPI()
Ejemplo n.º 7
0
    def __init__(self):
        super(MeteringPlugin, self).__init__()

        self.meter_rpc = metering_rpc_agent_api.MeteringAgentNotifyAPI()
        self.start_rpc_listeners()