]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix DetachedInstanceError for Agent instance
authorarmando-migliaccio <armamig@gmail.com>
Thu, 20 Feb 2014 08:21:19 +0000 (00:21 -0800)
committerGerrit Code Review <review@openstack.org>
Thu, 27 Feb 2014 14:48:11 +0000 (14:48 +0000)
commit237746a6d63c96726e7966770a602b62205ee333
treeb8f624cd13da6062f98be1c604370d7b9578e8f8
parent055bae5c084110949da7fab2a1058e891a7bd9a7
Fix DetachedInstanceError for Agent instance

The stacktrace observed seems to hint to a
situation where a session is not properly
rolled back when duplicate agent entries are
found.

Since it is ok to deal with duplicates, the
addition of agents to the DB must be done
one by one, otherwise we go against the
ATOMICITY property of a transaction of all
or none. It's either that or I am barking at
the wrong tree.

This patch also added UT to cover affected
code.

Closes-bug: 1282421
Related-bug: 1282253

Change-Id: Ic5f77808cc10f885d67f5a9cf3b3836283692850
neutron/scheduler/dhcp_agent_scheduler.py
neutron/tests/unit/test_dhcp_scheduler.py [new file with mode: 0644]