Use explicit loops instead of list comprehensions

Changes only the places where list comprehensions were used instead of loops
and their return values were not used

Change-Id: Ib518e77b26cf61cac4acb6a7e9b851aafffcd855
Move all db exception to exception.py

Moving InvalidSortKey, ColumnError  from oslo/db/sqlalchemy/utils.py to
oslo/db/exception.py for ease of use.
Add references in utils.py to exception py for backwards compatibility.

Change-Id: I38595d6bcceee84ef0ca7d88dae5617c006ba8c1
Added check for DB2 deadlock error

Currently, deadlock is only checked for in mysql and postgresql.
This adds a check for db2 deadlock

Fixes bug #1340793

Change-Id: Icef725ed75929ff13234ea58026e6bf0f2e2c852
Merge "Use explicit loops instead of list comprehensions"
Merge "Added check for DB2 deadlock error"
Merge "Move all db exception to exception.py"