]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix UnboundLocalError raised during L3 router sync task
authorarmando-migliaccio <armamig@gmail.com>
Tue, 1 Jul 2014 22:08:11 +0000 (15:08 -0700)
committerarmando-migliaccio <armamig@gmail.com>
Wed, 2 Jul 2014 14:04:57 +0000 (07:04 -0700)
commitfc01ddaaa5f1170b746f47837104352bfe36eaa5
tree3f4f051a46880e432f3918b61a6df8a72281b922
parentb5cd4c7cef64491069ae7461f0e5ee89568ec495
Fix UnboundLocalError raised during L3 router sync task

This can be fixed in a number of ways: a) consolidating the
two except clauses into one; b) adding a 'return' after the
last except clause c) by calling the cleanup method only on
success; d) initializing 'routers' before usage.

Approach c) has the benefit of stating the developer's intent
more explicitly and minimize chances of regression.

Closes-bug: #1336566

Change-Id: Ib91ac5bb07869cbec6825b60d7c4c5b23c4c4d3a
neutron/agent/l3_agent.py
neutron/tests/unit/test_l3_agent.py