Commit d4cf4ddc authored by Zuul's avatar Zuul Committed by Gerrit Code Review

Merge "Replace six.iteritems() with .items()"

parents bd842add c477796f
......@@ -84,7 +84,7 @@ class BlazarCommand(OpenStackCommand):
return parser
def format_output_data(self, data):
for k, v in six.iteritems(data):
for k, v in data.items():
if isinstance(v, six.text_type):
try:
# Deserialize if possible into dict, lists, tuples...
......@@ -134,7 +134,7 @@ class CreateCommand(BlazarCommand, show.ShowOne):
print('Created a new %s:' % self.resource, file=self.app.stdout)
else:
data = {'': ''}
return zip(*sorted(six.iteritems(data)))
return zip(*sorted(data.items()))
class UpdateCommand(BlazarCommand):
......@@ -291,4 +291,4 @@ class ShowCommand(BlazarCommand, show.ShowOne):
resource_manager = getattr(blazar_client, self.resource)
data = resource_manager.get(res_id)
self.format_output_data(data)
return zip(*sorted(six.iteritems(data)))
return zip(*sorted(data.items()))
......@@ -17,7 +17,6 @@ import datetime
import json
import os
import re
import six
from blazarclient import exception
from blazarclient.i18n import _
......@@ -52,13 +51,13 @@ def to_primitive(value):
return o
elif isinstance(value, dict):
o = {}
for k, v in six.iteritems(value):
for k, v in value.items():
o[k] = to_primitive(v)
return o
elif isinstance(value, datetime.datetime):
return str(value)
elif hasattr(value, 'iteritems'):
return to_primitive(dict(six.iteritems(value)))
return to_primitive(dict(value.items()))
elif hasattr(value, '__iter__'):
return to_primitive(list(value))
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment