]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove check on db_exc.DBError
authorIvan Kolodyazhny <e0ne@e0ne.info>
Wed, 15 Oct 2014 14:40:00 +0000 (17:40 +0300)
committerIvan Kolodyazhny <e0ne@e0ne.info>
Mon, 29 Dec 2014 10:50:45 +0000 (12:50 +0200)
After using oslo.db >= 0.4.0 we will never get DBError Exception

Change-Id: I94d6a155df1d71658e7271ab4d55122906216a87

cinder/db/sqlalchemy/api.py

index 7eb6ddac32e33d515123ce47107ef7533140c966..fd771a9b8155692b4bccd14fd6d38db720e5087f 100644 (file)
@@ -514,9 +514,8 @@ def iscsi_target_create_safe(context, values):
         with session.begin():
             session.add(iscsi_target_ref)
             return iscsi_target_ref
-    # TODO(e0ne): Remove check on db_exc.DBError, when
-    #             Cinder will use oslo.db 0.4.0 or higher.
-    except (db_exc.DBError, db_exc.DBDuplicateEntry):
+    except db_exc.DBDuplicateEntry:
+        LOG.debug("Can not add duplicate IscsiTarget.")
         return None