]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix DBDuplicateError handling in _ensure_default_security_group
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Wed, 18 Mar 2015 02:07:09 +0000 (11:07 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Wed, 18 Mar 2015 05:50:48 +0000 (14:50 +0900)
commit5dccff1cb3367f88b7a7851988b19caad313b036
tree159cc959afa93ef8c0fb31d51b3601654f2facb9
parentd7f4210ee3be3c0011c43c10b02b17d327bc9602
Fix DBDuplicateError handling in _ensure_default_security_group

The coding in change-id Ibb0597d4db187c856f9ac1d9700701e0165c3c73
catches and ignores DBDuplicateError in a nested transaction.
It would cause another exception, InvalidRequestError, on the
next operation.  ("This Session's transaction has been rolled back")
This commit fixes it.

Also, tweak a test case to expose the error.

Closes-Bug: #1433418
Related-Bug: #1419723
Change-Id: Ie4de271c0512fb2ecc6ed6842ad20386e3785a9c
neutron/db/securitygroups_db.py
neutron/tests/unit/test_extension_security_group.py