From 85078bd4e486fe663cfd1358b5cafd62afcb5f77 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Wed, 15 Oct 2014 17:40:00 +0300 Subject: [PATCH] Remove check on db_exc.DBError After using oslo.db >= 0.4.0 we will never get DBError Exception Change-Id: I94d6a155df1d71658e7271ab4d55122906216a87 --- cinder/db/sqlalchemy/api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cinder/db/sqlalchemy/api.py b/cinder/db/sqlalchemy/api.py index 7eb6ddac3..fd771a9b8 100644 --- a/cinder/db/sqlalchemy/api.py +++ b/cinder/db/sqlalchemy/api.py @@ -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 -- 2.45.2