Fix filter() usage due to python 3 compability
Fix filter() usage due to python 3 compability

Built-in method filter() returns a list in Python 2.x [1], but it
returns an iterator in Python 3.x [2]. To remove the difference (and
make code more readable, also), we use list comprehension instead of filer().

[1] http://docs.python.org/2/library/functions.html#filter
[2] http://docs.python.org/3/library/functions.html#filter

Related to blueprint make-python3-compatible

Change-Id: Ifd42403309ba3a44693e0c7c856a64b861eca3e9

openstack/oslo.db,magic0704/oslo.db,varunarya10/oslo.db,vikt0rs/oslo.db,akash1808/oslo.db,malor/oslo.db,JioCloud/oslo.db,openstack/oslo.db