← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1373816] [NEW] _get_security_groups_on_port tries to get [0] on a set type

 

Public bug reported:

_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.

** Affects: neutron
     Importance: Undecided
     Assignee: Jacek Świderski (jacek-swiderski)
         Status: New


** Tags: sg-fw

** Changed in: neutron
     Assignee: (unassigned) => Jacek Świderski (jacek-swiderski)

** Tags added: sg-fw

** Description changed:

  _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
  
- 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.
+         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.

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1373816

Title:
  _get_security_groups_on_port tries to get [0] on a set type

Status in OpenStack Neutron (virtual network service):
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1373816/+subscriptions


Follow ups

References