]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Allow None for binding:profile attribute
authorAkihiro MOTOKI <motoki@da.jp.nec.com>
Tue, 3 Sep 2013 12:57:53 +0000 (21:57 +0900)
committerAkihiro MOTOKI <motoki@da.jp.nec.com>
Wed, 4 Sep 2013 16:16:52 +0000 (01:16 +0900)
commitd632b66dc8b701ca777af4335b6505b4c4cd7828
treefae28b0edd6b5391e8fe805ebaefb5284a211945
parent30c115843d3a0b6d56c23cf140d178d44d6866de
Allow None for binding:profile attribute

We need to pass None in binding:profile to allow an administrator
to clear binding:profile attribute.

Closes-Bug: #1220011

Adds dedicated unit tests to the plugins which uses binding:profile
attribute (Mellanox and NEC plugins at now).

This commit also adds common unit tests for binding:profile to
the common PortBindingTestCase class.
- create_port with binding:profile whose value is None or {}
- update_port with binding:profile whose value is None or {}
- Reject binding:profile from non-admin user

Note that _make_port() in BigSwitch plugin test is updated
to allow passing arg_list() from the base test class.

Fix a bug in NEC plugin that 500 is returned when putting
binding:profile None to a port whose binding:profile is
already None (Closes-Bug: #1220720)

Change-Id: I146afe961cd445a023adc7233588d8034fdb8437
neutron/extensions/portbindings.py
neutron/plugins/nec/nec_plugin.py
neutron/tests/unit/_test_extension_portbindings.py
neutron/tests/unit/bigswitch/test_restproxy_plugin.py
neutron/tests/unit/mlnx/test_mlnx_plugin.py
neutron/tests/unit/nec/test_portbindings.py