2014-09-25 08:43:46 |
Jacek Świderski |
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
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. |
_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. |
|