]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix _ensure_default_security_group logic
authorEugene Nikanorov <enikanorov@mirantis.com>
Sat, 18 Jul 2015 23:17:43 +0000 (03:17 +0400)
committerOleg Bondarev <obondarev@mirantis.com>
Thu, 20 Aug 2015 09:26:31 +0000 (12:26 +0300)
commit80ee562dec3f397ea6c18a4ca3a1e69ab996341e
tree277244be9d7dfd95ab62b13bd292a681182eb611
parent194489b0f4885a2909333446a815896ea4d60320
Fix _ensure_default_security_group logic

In a case when first attempt to fetch default security group
fails and attempt to add it fails too due to a concurrent insertion,
later attempt to fetch the same default sg may fail due to
REPEATABLE READ transaction isolation level.
For this case RetryRequest should be issued to restart the
whole transaction and be able to see default group.

The patch also removes 'while True' logic as it's unsafe

Closes-Bug: #1475938
Change-Id: I20f65d3eae9421429aced1f4586cb6988ab577ff
neutron/db/securitygroups_db.py
neutron/plugins/ml2/plugin.py