]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Use admin context when removing DVR router on vm port deletion
authorOleg Bondarev <obondarev@mirantis.com>
Tue, 15 Dec 2015 14:58:51 +0000 (17:58 +0300)
committerOleg Bondarev <obondarev@mirantis.com>
Wed, 13 Jan 2016 09:43:23 +0000 (12:43 +0300)
commit96ba199d733944e5b8aa3664a04d9204fd66c878
treed27bf701dc2c9eb8fb5a67bd34afdd71b72148cf
parent6576b7061ea4c4068246bbd01f605a12e689c2c6
Use admin context when removing DVR router on vm port deletion

In case non-admin tenant removes last VM on a shared network (owned
by admin) connected to a DVR router (also owned by admin) we need
to remove the router from the host where there are no more dvr
serviceable ports. Commit edbade486102a219810137d1c6b916e87475d477
fixed logic that determines routers that should be removed from host.
However in order to actually remove the router we also need admin
context.

This was not caught by unit tests and one reason for that is so called
'mock everything' approach which is evil and generally useless.
This patch replaces unit tests with functional tests that we able
to catch the bug.

Closes-Bug: #1424096
Change-Id: Ia6cdf2294562c2a2727350c78eeab155097e0c33
neutron/db/l3_dvrscheduler_db.py
neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py
neutron/tests/unit/scheduler/test_l3_agent_scheduler.py