Some port attributes are ignored in bulk port create: allowed_address_pairs, extra_dhcp_opts

Bug #2003553 reported by Bence Romsics
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Bence Romsics

Bug Description

It seems the bulk port create API ignores some of the port attributes it receives:

export TOKEN="$( openstack token issue -f value -c id )"

# bulk equivalent of
# openstack --debug port create port0 --network private --allowed-address ip-address=10.0.0.1,mac-address=01:23:45:67:89:ab

curl -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -d "{\"ports\":[{\"name\":\"port0\",\"network_id\":\"$( openstack net show private -f value -c id )\",\"allowed_address_pairs\":[{\"ip_address\":\"10.0.0.1\",\"mac_address\":\"01:23:45:67:89:ab\"}]}]}" -X POST http://127.0.0.1:9696/networking/v2.0/ports | json_pp
...
         "allowed_address_pairs" : [],
...

# bulk equivalent of
# openstack --debug port create port0 --network private --extra-dhcp-option name=domain-name-servers,value=10.0.0.1,ip-version=4

curl -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -d "{\"ports\":[{\"name\":\"port0\",\"network_id\":\"$( openstack net show private -f value -c id )\",\"extra_dhcp_opts\":[{\"opt_name\":\"domain-name-servers\",\"opt_value\":\"10.0.0.1\",\"ip_version\":\"4\"}]}]}" -X POST http://127.0.0.1:9696/networking/v2.0/ports | json_pp
...
         "extra_dhcp_opts" : [],
...

neutron b71b25820be6d61ed9f249eddf32bfa49ac76524

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/871294

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
Bence Romsics (bence-romsics) wrote :

I believe the following change introduced this bug:
https://review.opendev.org/c/openstack/neutron/+/624815

It was merged in stein, which is already EOLd. But I think it makes sense to backport this up to train. When the fix merges I will propose the backports.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/871294
Committed: https://opendev.org/openstack/neutron/commit/ed68ba4a4cb622a67a4b28065da7f1ef7777e0dd
Submitter: "Zuul (22348)"
Branch: master

commit ed68ba4a4cb622a67a4b28065da7f1ef7777e0dd
Author: Bence Romsics <email address hidden>
Date: Fri Jan 20 16:26:21 2023 +0100

    Do not ignore attributes in bulk port create

    With unit tests that would have caught the bug.

    Change-Id: Ia4a68bdccecfbcb9d1aa49e2b14e06d139891c0f
    Closes-Bug: #2003553

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/zed)

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/neutron/+/872880

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/872880
Committed: https://opendev.org/openstack/neutron/commit/1b086f1c1fd0879224e61b05e3d4bb54486ea62c
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 1b086f1c1fd0879224e61b05e3d4bb54486ea62c
Author: Bence Romsics <email address hidden>
Date: Fri Jan 20 16:26:21 2023 +0100

    Do not ignore attributes in bulk port create

    With unit tests that would have caught the bug.

    Change-Id: Ia4a68bdccecfbcb9d1aa49e2b14e06d139891c0f
    Closes-Bug: #2003553
    (cherry picked from commit ed68ba4a4cb622a67a4b28065da7f1ef7777e0dd)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/neutron/+/873963

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/neutron/+/874130

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/874131

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/873963
Committed: https://opendev.org/openstack/neutron/commit/9df4a7e398fa69315a759737bbb991c892c73e80
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 9df4a7e398fa69315a759737bbb991c892c73e80
Author: Bence Romsics <email address hidden>
Date: Fri Jan 20 16:26:21 2023 +0100

    Do not ignore attributes in bulk port create

    With unit tests that would have caught the bug.

    Change-Id: Ia4a68bdccecfbcb9d1aa49e2b14e06d139891c0f
    Closes-Bug: #2003553
    (cherry picked from commit ed68ba4a4cb622a67a4b28065da7f1ef7777e0dd)
    (cherry picked from commit 1b086f1c1fd0879224e61b05e3d4bb54486ea62c)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/874130
Committed: https://opendev.org/openstack/neutron/commit/719ef724f5c732f23f17b9bcf558be9a2fe0e53c
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 719ef724f5c732f23f17b9bcf558be9a2fe0e53c
Author: Bence Romsics <email address hidden>
Date: Fri Jan 20 16:26:21 2023 +0100

    Do not ignore attributes in bulk port create

    With unit tests that would have caught the bug.

    Conflicts:
        neutron/tests/unit/plugins/ml2/test_plugin.py

    Change-Id: Ia4a68bdccecfbcb9d1aa49e2b14e06d139891c0f
    Closes-Bug: #2003553
    (cherry picked from commit ed68ba4a4cb622a67a4b28065da7f1ef7777e0dd)
    (cherry picked from commit 1b086f1c1fd0879224e61b05e3d4bb54486ea62c)

tags: added: in-stable-xena
tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/874131
Committed: https://opendev.org/openstack/neutron/commit/fb49c57e5d2c3c4fa6843c97f87772f70ff67927
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit fb49c57e5d2c3c4fa6843c97f87772f70ff67927
Author: Bence Romsics <email address hidden>
Date: Fri Jan 20 16:26:21 2023 +0100

    Do not ignore attributes in bulk port create

    With unit tests that would have caught the bug.

    Conflicts:
        neutron/tests/unit/plugins/ml2/test_plugin.py

    Change-Id: Ia4a68bdccecfbcb9d1aa49e2b14e06d139891c0f
    Closes-Bug: #2003553
    (cherry picked from commit ed68ba4a4cb622a67a4b28065da7f1ef7777e0dd)
    (cherry picked from commit 1b086f1c1fd0879224e61b05e3d4bb54486ea62c)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 22.0.0.0rc1

This issue was fixed in the openstack/neutron 22.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 19.6.0

This issue was fixed in the openstack/neutron 19.6.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 20.3.0

This issue was fixed in the openstack/neutron 20.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/877352

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 21.1.0

This issue was fixed in the openstack/neutron 21.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/877352
Committed: https://opendev.org/openstack/neutron/commit/2c7391c82315f73ca1a3a03d4ec4142a42f61fd9
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 2c7391c82315f73ca1a3a03d4ec4142a42f61fd9
Author: Bence Romsics <email address hidden>
Date: Fri Jan 20 16:26:21 2023 +0100

    Do not ignore attributes in bulk port create

    With unit tests that would have caught the bug.

    Conflicts:
        neutron/tests/unit/plugins/ml2/test_plugin.py

    Change-Id: Ia4a68bdccecfbcb9d1aa49e2b14e06d139891c0f
    Closes-Bug: #2003553
    (cherry-picked from commit fb49c57e5d2c3c4fa6843c97f87772f70ff67927)
    (cherry picked from commit ed68ba4a4cb622a67a4b28065da7f1ef7777e0dd)
    (cherry picked from commit 1b086f1c1fd0879224e61b05e3d4bb54486ea62c)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron victoria-eom

This issue was fixed in the openstack/neutron victoria-eom release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron wallaby-eom

This issue was fixed in the openstack/neutron wallaby-eom release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.