]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Port to oslo.messaging
authorIhar Hrachyshka <ihrachys@redhat.com>
Mon, 2 Jun 2014 15:40:38 +0000 (17:40 +0200)
committerIhar Hrachyshka <ihrachys@redhat.com>
Thu, 19 Jun 2014 10:58:01 +0000 (12:58 +0200)
commitdeb27d9c24d3745ff062bc437081bd67cf10059f
tree8a22f591ea529807995a72e096eb06d24426f23e
parent24718e6f1764e95f0c393ba042546e3584981b31
Port to oslo.messaging

Now that all preparations are done, actually port the code to use
oslo.messaging. This patch does as little as possible. Follow up patches
that refactor and cleanup the code and configuration files, will be
merged later. The reason for this is to make the patch as slim as
possible, to make review process more smooth and concentrated.

Details:
* neutron/common/rpc.py:
  - added init() and cleanup() to set global RPC layer state.
  - added utility functions: get_server(), get_client(), get_notifier()
    that wrap up oslo.messaging API a bit, enforcing eventlet executor
    and setting serializer, among other things.
  - removed PluginRpcDispatcher, instead introduced PluginRpcSerializer
    to use as a default serializer for API callbacks.

* neutron/common/rpc_compat.py:
  - emulated incubator RPC layer behaviour thru previously introduced
    stub classes (RpcCallback, RpcProxy, ...) using new oslo.messaging
    API.
  - switched to using new oslo.messaging exception types.

* neutron/service.py:
  - expect multiple RPC listeners that are of MessageHandlingServer
    type, not GreenThread.

* neutron/common/config.py:
  - initialize RPC layer in init()

* setup.cfg:
  - added entry points for old notifier drivers to retain backward
    compatibility.

* neutron/tests/...:
  - introduced fake_notifier to replace impl_fake.
  - faked out consume_in_thread() to avoid starting RPC listeners when
    running unit tests.
  - used 'fake' transport driver.
  - made sure neutron.test.* exceptions are caught.
  - initialize and clean up RPC layer for each test case.

* Ported all affected code from using neutron.openstack.common.notifier
  API to oslo.messaging.Notifier.

* rpc.set_defaults() was renamed to rpc.set_transport_defaults()

* other changes not worth mentioning here.

blueprint oslo-messaging

DocImpact

Change-Id: I5a91c34df6e300f2dc46217b1b16352fcc3039fc
56 files changed:
neutron/api/v2/base.py
neutron/cmd/usage_audit.py
neutron/common/config.py
neutron/common/rpc.py
neutron/common/rpc_compat.py
neutron/db/l3_db.py
neutron/db/metering/metering_rpc.py
neutron/openstack/common/service.py
neutron/plugins/bigswitch/agent/restproxy_agent.py
neutron/plugins/bigswitch/plugin.py
neutron/plugins/brocade/NeutronPlugin.py
neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py
neutron/plugins/hyperv/agent/hyperv_neutron_agent.py
neutron/plugins/hyperv/rpc_callbacks.py
neutron/plugins/ibm/agent/sdnve_neutron_agent.py
neutron/plugins/ibm/sdnve_neutron_plugin.py
neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
neutron/plugins/linuxbridge/lb_neutron_plugin.py
neutron/plugins/midonet/plugin.py
neutron/plugins/ml2/rpc.py
neutron/plugins/mlnx/agent/eswitch_neutron_agent.py
neutron/plugins/mlnx/rpc_callbacks.py
neutron/plugins/nec/agent/nec_neutron_agent.py
neutron/plugins/nec/common/config.py
neutron/plugins/nec/nec_plugin.py
neutron/plugins/ofagent/agent/ofa_neutron_agent.py
neutron/plugins/oneconvergence/agent/nvsd_neutron_agent.py
neutron/plugins/oneconvergence/plugin.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/plugins/openvswitch/ovs_neutron_plugin.py
neutron/plugins/ryu/agent/ryu_neutron_agent.py
neutron/plugins/ryu/ryu_neutron_plugin.py
neutron/plugins/vmware/dhcp_meta/rpc.py
neutron/policy.py
neutron/service.py
neutron/services/firewall/fwaas_plugin.py
neutron/services/l3_router/l3_router_plugin.py
neutron/services/loadbalancer/drivers/common/agent_driver_base.py
neutron/services/metering/agents/metering_agent.py
neutron/services/vpn/device_drivers/cisco_ipsec.py
neutron/services/vpn/device_drivers/ipsec.py
neutron/services/vpn/service_drivers/cisco_ipsec.py
neutron/services/vpn/service_drivers/ipsec.py
neutron/tests/base.py
neutron/tests/fake_notifier.py [new file with mode: 0644]
neutron/tests/unit/hyperv/test_hyperv_rpcapi.py
neutron/tests/unit/linuxbridge/test_rpcapi.py
neutron/tests/unit/ml2/test_rpcapi.py
neutron/tests/unit/mlnx/test_rpcapi.py
neutron/tests/unit/openvswitch/test_ovs_rpcapi.py
neutron/tests/unit/services/metering/test_metering_agent.py
neutron/tests/unit/test_agent_rpc.py
neutron/tests/unit/test_api_v2.py
neutron/tests/unit/test_l3_plugin.py
requirements.txt
setup.cfg