neutron code redundancy

Bug #1265132 reported by shihanzhang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
shihanzhang

Bug Description

I found the code in l3_db.py is redundant,the code is below:
in function _update_router_gw_info:

        if gw_port and gw_port['network_id'] != network_id:
            fip_count = self.get_floatingips_count(context.elevated(),
                                                   {'router_id': [router_id]})
            if fip_count:
                raise l3.RouterExternalGatewayInUseByFloatingIp(
                    router_id=router_id, net_id=gw_port['network_id'])
            if gw_port and gw_port['network_id'] != network_id:
                with context.session.begin(subtransactions=True):
                    router.gw_port = None
                    context.session.add(router)
                self._core_plugin.delete_port(context.elevated(),
                                              gw_port['id'],
                                              l3_port_check=False)

it does not need the third if!

Changed in neutron:
assignee: nobody → shihanzhang (shihanzhang)
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/64508

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit 02f4516ad38c5deeefd686b87edf4bf06cffe5af
Author: shihanzhang <email address hidden>
Date: Tue Dec 31 15:22:40 2013 +0800

    Remove redundant codes

    the code is redundant, it should be removed

    Change-Id: I050bfc0b4d72037510dc2f3d729a564869a374c2
    Closes-Bug: #1265132

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-2 → 2014.1
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.