]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Port API types extra specs to Python 3
authorVictor Stinner <vstinner@redhat.com>
Wed, 7 Oct 2015 16:41:48 +0000 (18:41 +0200)
committerVictor Stinner <vstinner@redhat.com>
Wed, 14 Oct 2015 20:17:26 +0000 (22:17 +0200)
* 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
tests-py3.txt

index 26bc1faedc812449eb32b10107322df0282cb3b5..cc169144edf48deb42e6507c3684894dfb087f18 100644 (file)
@@ -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)
 
index 22559d67bac2198f88e2667238a4694ca806cb68..d3c57beccebc26da159f84c93d7f57ec2c741725 100644 (file)
@@ -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