]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Catch DBDuplicateEntry instead of IntegrityError
authorIvan Kolodyazhny <e0ne@e0ne.info>
Mon, 4 Aug 2014 15:16:10 +0000 (18:16 +0300)
committerRoman Podoliaka <rpodolyaka@mirantis.com>
Thu, 14 Aug 2014 16:20:01 +0000 (16:20 +0000)
commit331071a3e2f1ee6783e6a908789af40835818eed
tree9f6c5319b2b2bc6ce48c5eb159ad734158647a53
parentbbf8f854455f655897e81f33c06e132d6c5274a7
Catch DBDuplicateEntry instead of IntegrityError

'iscsi_target_create_safe' method didn't catch DB exceptions
correct.

Need to catch both db_exc.DBError and db_exc.DBDuplicateEntry
due to current oslo.db limitations: it doesn't handle correct
DBDuplicateEntry with different SQLite versions

Related-Bug: #1187367

Change-Id: Ie412ecabd3cbcac301340c82b4275adb7a7206c3
cinder/db/sqlalchemy/api.py
cinder/tests/test_db_api.py