From 08b6b23cad254200b45d063ed6996d22f1d65626 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 7 Oct 2015 18:41:48 +0200 Subject: [PATCH] Port API types extra specs to Python 3 * Replace dict.iteritems() with dict.items(). The iteritems() method of dictionaries was removed in Python 3. * Add cinder.tests.unit.api.contrib tests to tests-py3.txt: - test_availability_zones - test_capabilities - test_extended_snapshot_attributes - test_hosts - test_qos_specs_manage - test_quotas - test_quotas_classes - test_scheduler_stats - test_services - test_types_extra_specs - test_types_manage - test_used_limits Partial-Implements: blueprint cinder-python3 Change-Id: Ie3d2de456c34286cca0505f6125a1a723bd8ad8b --- cinder/api/contrib/types_extra_specs.py | 2 +- tests-py3.txt | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cinder/api/contrib/types_extra_specs.py b/cinder/api/contrib/types_extra_specs.py index 26bc1faed..cc169144e 100644 --- a/cinder/api/contrib/types_extra_specs.py +++ b/cinder/api/contrib/types_extra_specs.py @@ -56,7 +56,7 @@ class VolumeTypeExtraSpecsController(wsgi.Controller): def _get_extra_specs(self, context, type_id): extra_specs = db.volume_type_extra_specs_get(context, type_id) specs_dict = {} - for key, value in extra_specs.iteritems(): + for key, value in extra_specs.items(): specs_dict[key] = value return dict(extra_specs=specs_dict) diff --git a/tests-py3.txt b/tests-py3.txt index 22559d67b..d3c57becc 100644 --- a/tests-py3.txt +++ b/tests-py3.txt @@ -1,3 +1,15 @@ +cinder.tests.unit.api.contrib.test_availability_zones +cinder.tests.unit.api.contrib.test_capabilities +cinder.tests.unit.api.contrib.test_extended_snapshot_attributes +cinder.tests.unit.api.contrib.test_hosts +cinder.tests.unit.api.contrib.test_qos_specs_manage +cinder.tests.unit.api.contrib.test_quotas +cinder.tests.unit.api.contrib.test_quotas_classes +cinder.tests.unit.api.contrib.test_scheduler_stats +cinder.tests.unit.api.contrib.test_services +cinder.tests.unit.api.contrib.test_types_extra_specs +cinder.tests.unit.api.contrib.test_types_manage +cinder.tests.unit.api.contrib.test_used_limits cinder.tests.unit.api.openstack.test_wsgi cinder.tests.unit.api.test_common cinder.tests.unit.api.test_extensions -- 2.45.2