duplicately fetch subnet_id in get_subnet_for_dvr

Bug #1531065 reported by ZongKai LI
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

In https://github.com/openstack/neutron/blob/77a6d114eae9de8078b358a9bd8502fb7c393641/neutron/db/dvr_mac_db.py#L159-L163, get_subnet_for_dvr will try to get subnet_id when fixed_ips is not None:
    def get_subnet_for_dvr(self, context, subnet, fixed_ips=None):
        if fixed_ips:
            subnet_data = fixed_ips[0]['subnet_id']
            subnet_data = subnet

But checking its callers :
https://github.com/openstack/neutron/blob/77a6d114eae9de8078b358a9bd8502fb7c393641/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_dvr_neutron_agent.py#L509-L531 ,
https://github.com/openstack/neutron/blob/77a6d114eae9de8078b358a9bd8502fb7c393641/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_dvr_neutron_agent.py#L366-L380 , they all have similar logic:
        fixed_ip = fixed_ips[0]
        subnet_uuid = fixed_ip['subnet_id']
            subnet_info = self.plugin_rpc.get_subnet_for_dvr(
                self.context, subnet_uuid, fixed_ips=fixed_ips)

subnet_id has already be fetched and passed into get_subnet_for_dvr. So in get_subnet_for_dvr, there is no need to fetch again.

ZongKai LI (zongkai)
Changed in neutron:
assignee: nobody → ZongKai LI (lzklibj)
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/263563

Changed in neutron:
status: New → In Progress
Akihiro Motoki (amotoki)
tags: added: l3-dvr-backlog
Changed in neutron:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Armando Migliaccio (<email address hidden>) on branch: master
Review: https://review.openstack.org/263563
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Changed in neutron:
status: In Progress → Incomplete
assignee: ZongKai LI (lzklibj) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers