_get_security_groups_on_port tries to get [0] on a set type

Bug #1373816 reported by Jacek Świderski
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Kevin Benton

Bug Description

_get_security_groups_on_port checks before that all security groups on port belong to tenant - and if there are any that don't fulfill this requirement it tries to raise SecurityGroupNotFound but fails with :
TypeError: 'set' object does not support indexing

        port_sg_missing = requested_groups - valid_groups
        if port_sg_missing:
            raise ext_sg.SecurityGroupNotFound(id=str(port_sg_missing[0]))

One thing is the fail itself - but beside I think that message = _("Security group %(id)s does not exist"), where id would be a randomly chosen missing id isn't really clear in this context and new exception should be created for this case.

Tags: sg-fw
Changed in neutron:
assignee: nobody → Jacek Świderski (jacek-swiderski)
tags: added: sg-fw
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/124070

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Salvatore Orlando (<email address hidden>) on branch: master
Review: https://review.openstack.org/124070
Reason: This patch has been inactive long enough that I think it's safe to abandon.
The author can resurrect it if needed.

Revision history for this message
watanabe.isao (watanabe.isao) wrote :

Hello, Jacek Świderski.
Our team hit this bug in our test, too.
We would like to see this bug fixed in kilo, best as your idea.
Are your still working on this issue?
If not, may I continue with your work in this bug report and in the gerrit brunch[1]?

[1]https://review.openstack.org/#/c/124070/

Revision history for this message
Jacek Świderski (jacek-swiderski) wrote :

Hello, Isao.
Feel free to take over my change I'm not currently working on OpenStack - I've restored it on gerrit for you.

Jacek

Revision history for this message
watanabe.isao (watanabe.isao) wrote :

Hello, Jacek Świderski.
Thank you for your help. (^^)

Changed in neutron:
assignee: Jacek Świderski (jacek-swiderski) → watanabe.isao (watanabe.isao)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/152373

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by watanabe isao (<email address hidden>) on branch: master
Review: https://review.openstack.org/152373

Changed in neutron:
assignee: watanabe.isao (watanabe.isao) → Kevin Benton (kevinbenton)
Kyle Mestery (mestery)
Changed in neutron:
milestone: none → kilo-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/124070
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=d907762f3cca1405eedaaad5d5841491576c8c54
Submitter: Jenkins
Branch: master

commit d907762f3cca1405eedaaad5d5841491576c8c54
Author: Kevin Benton <email address hidden>
Date: Fri Mar 27 23:18:08 2015 -0700

    Fix error raising in security groups method

    In case there were security groups not belonging to tenant on port
    _get_security_groups_on_port would try to raise exception but fail
    trying to index set.

    This patch simply joins the whole set as a string and inserts it
    into the standard SecurityGroupNotFound exception.

    No new exception types, no string freeze violations.

    Co-Author: watanabe.isao <email address hidden>
    Co-Author: Jacek Swiderski <email address hidden>

    Change-Id: I039ea57269dc53ced8dece0985f33ce9ae7eab17
    Closes-Bug: #1373816

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-rc1 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (neutron-pecan)

Fix proposed to branch: neutron-pecan
Review: https://review.openstack.org/185072

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.