Fix map usage on py3 in v2 test_volumes_snapshots_list
This commit fixes the usage around map in
test_snapshot_list_param_marker(). In py2 map() returns a list, but in
py3 map() returns an map iterator. To work around this difference simply
use a list comprehension instead.
Change-Id: I0219ee7ac35d7389263af67eb0dde2b0f96ea22f
diff --git a/tempest/api/volume/v2/test_volumes_snapshots_list.py b/tempest/api/volume/v2/test_volumes_snapshots_list.py
index 8f68322..f389b59 100644
--- a/tempest/api/volume/v2/test_volumes_snapshots_list.py
+++ b/tempest/api/volume/v2/test_volumes_snapshots_list.py
@@ -13,8 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import operator
-
from tempest.api.volume import base
from tempest import config
from tempest import test
@@ -89,7 +87,7 @@
# The list of snapshots should end before the provided marker
params = {'marker': self.snapshot_id_list[1]}
snap_list = self.snapshots_client.list_snapshots(**params)['snapshots']
- fetched_list_id = map(operator.itemgetter('id'), snap_list)
+ fetched_list_id = [snap['id'] for snap in snap_list]
# Verify the list of snapshots ends before the provided
# marker(second snapshot), therefore only the first snapshot
# should displayed.