Replace dict.iteritems() with dict.items()
Replace dict.iteritems() which is no longer present in Python 3 with dict.items(). Do not use six.iteritems because discussion in mail list http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Change-Id: I51ac7904f9194a6c9ed72c1cb0e7afdc535f6bd4 Partially-Implements: blueprint magnum-python3
This commit is contained in:
parent
9d921666ad
commit
3086de9ed6
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
from glanceclient import exc as glance_exception
|
from glanceclient import exc as glance_exception
|
||||||
from novaclient import exceptions as nova_exception
|
from novaclient import exceptions as nova_exception
|
||||||
import six
|
|
||||||
|
|
||||||
from magnum.api import utils as api_utils
|
from magnum.api import utils as api_utils
|
||||||
from magnum.common import clients
|
from magnum.common import clients
|
||||||
@ -87,7 +86,7 @@ def validate_os_resources(context, baymodel_id):
|
|||||||
baymodel = BayModel.get_by_uuid(context, baymodel_id)
|
baymodel = BayModel.get_by_uuid(context, baymodel_id)
|
||||||
cli = clients.OpenStackClients(context)
|
cli = clients.OpenStackClients(context)
|
||||||
|
|
||||||
for attr, validate_method in six.iteritems(validators):
|
for attr, validate_method in validators.items():
|
||||||
if attr in baymodel and baymodel[attr] is not None:
|
if attr in baymodel and baymodel[attr] is not None:
|
||||||
validate_method(cli, baymodel[attr])
|
validate_method(cli, baymodel[attr])
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ class DbMagnumServiceTestCase(base.DbTestCase):
|
|||||||
res = self.dbapi.get_magnum_service_list(self.context)
|
res = self.dbapi.get_magnum_service_list(self.context)
|
||||||
self.assertEqual(1, len(res))
|
self.assertEqual(1, len(res))
|
||||||
res = res[0]
|
res = res[0]
|
||||||
for k, v in fake_ms_params.iteritems():
|
for k, v in fake_ms_params.items():
|
||||||
self.assertEqual(res[k], v)
|
self.assertEqual(res[k], v)
|
||||||
|
|
||||||
fake_ms_params['binary'] = 'FakeBin1'
|
fake_ms_params['binary'] = 'FakeBin1'
|
||||||
@ -96,5 +96,5 @@ class DbMagnumServiceTestCase(base.DbTestCase):
|
|||||||
res = self.dbapi.get_magnum_service_list(self.context, disabled=True)
|
res = self.dbapi.get_magnum_service_list(self.context, disabled=True)
|
||||||
self.assertEqual(1, len(res))
|
self.assertEqual(1, len(res))
|
||||||
res = res[0]
|
res = res[0]
|
||||||
for k, v in fake_ms_params.iteritems():
|
for k, v in fake_ms_params.items():
|
||||||
self.assertEqual(res[k], v)
|
self.assertEqual(res[k], v)
|
||||||
|
Loading…
Reference in New Issue
Block a user