]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Removing a router twice from the same agent shouldn't cause an error
authorYoni Shafrir <yshafrir@redhat.com>
Wed, 21 Jan 2015 06:25:50 +0000 (08:25 +0200)
committerYoni Shafrir <yshafrir@redhat.com>
Mon, 2 Mar 2015 13:07:41 +0000 (15:07 +0200)
commitf78ce6782a57d6fd63c6e1dabd6a45cbd5c458cc
tree801340f0dec9d8f42c6c5d5ff3c3415f0d973cb6
parent64bd24f9d63f679140b770eb59e196636d71926c
Removing a router twice from the same agent shouldn't cause an error

When we remove a router from an agent that has already been
unscheduled from we raise an exception that eventually causes an error.
The method '_unbind_router' raises a 'RouterNotHostedByL3Agent' exception
on failure. In both cases the actual removal of the router
from the same agent has no effect.

The solution is to stop raising 'RouterNotHostedByL3Agent' so
that _unbind_router() being invoked without error can indicate that
the router is no longer bound.

This solution matches the behaviour found when trying
to schedule a router to the same agent twice.

This change is a result of the discussion in:

https://review.openstack.org/#/c/144681/2

Closes-Bug: #1406705

Change-Id: I015bfc0fde11ba4f39417e4c134faa8132cb3eac
neutron/db/l3_agentschedulers_db.py
neutron/extensions/l3agentscheduler.py
neutron/plugins/ml2/plugin.py
neutron/tests/unit/ml2/test_ml2_plugin.py
neutron/tests/unit/test_l3_schedulers.py