Bulk port creation with supplied security group also adds default security group

Bug #1842666 reported by Nate Johnston
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Nate Johnston

Bug Description

When bulk ports are created with a security group supplied, the resulting port(s) should only have that security group assigned. But the resulting ports are getting both the requested security group as well as the tenant default security group assigned.

Revision history for this message
Bernard Cafarelli (bcafarel) wrote :

Indeed, reproduced it on devstack master with:

$ cat bulk_secgroups.json
{
  "ports": [
    {
      "network_id": "226ac6be-753b-46d3-8636-5ad226297ab0",
      "security_groups": ["91e47ea5-3d9c-437b-a31e-0a2fd8d3181f"]
    }
  ]
}

$ export MY_TOKEN=$(openstack token issue -c id -f value)
$ curl -H "X-Auth-Token: $MY_TOKEN" -X POST http://127.0.0.1:9696/v2.0/ports -d @bulk_secgroups.json | jq .ports[0].id
"91ec92c1-4d9c-4a8b-b5d1-55769c4c75c2"
 openstack port show 91ec92c1-4d9c-4a8b-b5d1-55769c4c75c2|grep security_group
| security_group_ids | 91e47ea5-3d9c-437b-a31e-0a2fd8d3181f, fc3f8c84-118e-46c5-8dc7-18d02ef926af
$ openstack security group show default -f value -c id
fc3f8c84-118e-46c5-8dc7-18d02ef926af

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

Reviewed: https://review.opendev.org/679852
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=88c7be55c221a87b4326a915580657f34d1ff582
Submitter: Zuul
Branch: master

commit 88c7be55c221a87b4326a915580657f34d1ff582
Author: Nate Johnston <email address hidden>
Date: Tue Sep 3 15:56:59 2019 -0400

    Fix bulk port functioning with requested security groups

    When bulk ports are created with a security group supplied, the
    resulting port(s) should only have that security group assigned. But the
    resulting ports are getting both the requested security group as well as
    the tenant default security group assigned. This fixes that condition.

    In order to ensure that bulk port creation results in the proper
    assignment of security groups, add some testing.

    Change-Id: I65aca7cd14447cc988e4bc4ab62bc7b9279e7522
    Fixes-Bug: #1842666

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

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/681585

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

Reviewed: https://review.opendev.org/681585
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=0f4f48c716915085e205ffd4297a2547119c1982
Submitter: Zuul
Branch: stable/stein

commit 0f4f48c716915085e205ffd4297a2547119c1982
Author: Nate Johnston <email address hidden>
Date: Tue Sep 3 15:56:59 2019 -0400

    Fix bulk port functioning with requested security groups

    When bulk ports are created with a security group supplied, the
    resulting port(s) should only have that security group assigned. But the
    resulting ports are getting both the requested security group as well as
    the tenant default security group assigned. This fixes that condition.

    In order to ensure that bulk port creation results in the proper
    assignment of security groups, add some testing.

    Change-Id: I65aca7cd14447cc988e4bc4ab62bc7b9279e7522
    Fixes-Bug: #1842666
    (cherry picked from commit 88c7be55c221a87b4326a915580657f34d1ff582)

tags: added: in-stable-stein
tags: added: neutron-proactive-backport-potential
Revision history for this message
Nate Johnston (nate-johnston) wrote :

Removed the neutron-proactive-backport-potential as this has already been backpoorted to stable/stein, which is the only release where it is valid.

tags: removed: neutron-proactive-backport-potential
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.