]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Make ML2 ensure_dvr_port_binding more robust
authorarmando-migliaccio <armamig@gmail.com>
Fri, 4 Jul 2014 00:00:44 +0000 (17:00 -0700)
committerarmando-migliaccio <armamig@gmail.com>
Fri, 1 Aug 2014 02:54:00 +0000 (19:54 -0700)
commit0b30651678e1e2e574553272c0f9ab69418efe96
tree514992dcc820d46b7f73598640dc1890b984f111
parent4ab8740cd81709ffdc54dee1962aa211fead44b8
Make ML2 ensure_dvr_port_binding more robust

There is a remote chance that this operation may
be prone to DB integrity errors, in case the binding
is attempted on the same port twice.

Ideally getter methods should not create, but this
is a common Neutron (anti)-pattern that would be
difficult to eradicate (at least in a single patch);
so for now let's make this code more defensive.

Related-bug: #1269131
Related-bug: #1335226

Change-Id: Ie6c57fd46f0752839814dbac5b14fae2364f973d
neutron/plugins/ml2/db.py
neutron/tests/unit/ml2/db/test_ml2_dvr_db.py