Modify some codes in order to lead them meet the python3 common pattern.
Look through the following patterns of Cinder,
map() and filter() if a list is needed on Python 3:
Replace map(func, data) with [func(item) for item in data]
Replace filter(lambda obj: test(obj), data) with
[obj for obj in data if test(obj)]
Replace exceptions.OSError with OSError and
remove "import exceptions"
Replace iterator.next() with next(iterator)
Replace basestring with six.string_types
Replace unicode with six.text_type
Replace (str, unicode) with six.string_types
Replace "for key in dict.iterkeys()" with "for key in dict"
Replace dict.iteritems() with dict.items()
Replace dict.itervalues() with dict.values()
I found that only "filter(lambda obj: test(obj), data)" and
"map(func, data)"need to modify.
The other items are not be founded in Cinder.
Reference:https://wiki.openstack.org/wiki/Python3#Common_patterns
Change-Id: If33ec39eb176c14086132d3099c6ec577f956ded