API comments mismatch for get_ports_from_devices

Bug #1397239 reported by yalei wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
yalei wang

Bug Description

get_ports_from_devices in ml2/plugin.py will return a emtry dict when the secgroup associated is empty, due to this line
        ports = db.get_ports_and_sgs(port_ids)

but refer to the comment in neutron/db/securitygroups_rpc_base.py, seems it should at least return a dict whose secgroup's value is emtry

    def get_port_from_device(self, device):
        """Get port dict from device name on an agent.

        Subclass must provide this method or get_ports_from_devices.

        :param device: device name which identifies a port on the agent side.
        What is specified in "device" depends on a plugin agent implementation.
        For example, it is a port ID in OVS agent and netdev name in Linux
        Bridge agent.
        :return: port dict returned by DB plugin get_port(). In addition,
        it must contain the following fields in the port dict returned.
        - device
        - security_groups
        - security_group_rules,
        - security_group_source_groups
        - fixed_ips

yalei wang (yalei-wang)
Changed in neutron:
assignee: nobody → yalei wang (yalei-wang)
Changed in neutron:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
yalei wang (yalei-wang) wrote :

this is a bug in get_ports_and_sgs, has been fixed in https://review.openstack.org/138633

yalei wang (yalei-wang)
Changed in neutron:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-2 → 2015.1.0
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.