]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Make SecurityGroupsRpcCallback a separate callback class
authorAkihiro Motoki <motoki@da.jp.nec.com>
Sat, 23 Aug 2014 09:16:18 +0000 (18:16 +0900)
committershihanzhang <shihanzhang@huawei.com>
Sat, 30 Aug 2014 02:19:42 +0000 (10:19 +0800)
commit2781fce238e79690bf707a3df4823aec422687bd
tree475f6540a27566648dabfd0a51750f3da2cf24b1
parent974178601d60f607593d49d416224b28553fe5ec
Make SecurityGroupsRpcCallback a separate callback class

RPC has a version of itself. In Neutron a plugin implements
several RPC interface, so a single RPC version doesn't work.
In Mixin callback class approach, RPC versioning depends on
each plugin implementation and it makes harder to maintain
RPC version appropriately. This patch series replaces mixin
RPC callback of server side with a separate class.

This commit handles server-side callback of security group
RPC interface.
* The server-side callback of Security group RPC is moved to
  api/rpc/handler and db/securitygroups_rpc_base now only
  contains a mixin class to add agent-based security group
  implementation with db operations.
* get_port_from_device method in server-side callback class
  is moved to a mixin class of plugin implementation
  (SecurityGroupServerRpcMixin) because it involves DB lookup
  and is tightly coupled with plugin implementation rather
  than RPC interface definition.

Most unit tests for SGServerRpcCallBackTestCase were skipped
in the base class before, but now they are no longer skipped.

The following items will be planned in later patches
to avoid drastic changes in a single patch.
* Merge security group RPC API and agent callback classes in
  agent/securitygroups_rpc into api/rpc/handlers/securitygroup_rpc
* Remove completely duplicated db access code in get_port_from_device
  and get_port_and_sgs

Partial-Bug: #1359416
Change-Id: Ia6535217d2e3b849a95667c1b53dd09675002892
22 files changed:
neutron/api/rpc/handlers/securitygroups_rpc.py [new file with mode: 0644]
neutron/db/securitygroups_rpc_base.py
neutron/plugins/bigswitch/plugin.py
neutron/plugins/brocade/NeutronPlugin.py
neutron/plugins/linuxbridge/lb_neutron_plugin.py
neutron/plugins/ml2/plugin.py
neutron/plugins/ml2/rpc.py
neutron/plugins/mlnx/mlnx_plugin.py
neutron/plugins/mlnx/rpc_callbacks.py
neutron/plugins/nec/nec_plugin.py
neutron/plugins/oneconvergence/plugin.py
neutron/plugins/openvswitch/ovs_neutron_plugin.py
neutron/plugins/ryu/ryu_neutron_plugin.py
neutron/tests/unit/bigswitch/test_security_groups.py
neutron/tests/unit/linuxbridge/test_linuxbridge_plugin.py
neutron/tests/unit/ml2/test_rpcapi.py
neutron/tests/unit/ml2/test_security_group.py
neutron/tests/unit/nec/test_security_group.py
neutron/tests/unit/oneconvergence/test_security_group.py
neutron/tests/unit/openvswitch/test_ovs_security_group.py
neutron/tests/unit/ryu/test_ryu_security_group.py
neutron/tests/unit/test_security_groups_rpc.py