Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Commit

Permalink
replace dict.iteritems() with six.iteritems(dict)
Browse files Browse the repository at this point in the history
According to https://wiki.openstack.org/wiki/Python3 dict.iteritems()
should be replaced with six.iteritems(dict).

Added six >= 1.6.0 as new requirement. Removed six from test requirements.

Change-Id: Ifba282b1bde9681268e6e46ffd024c96c6b9be05
  • Loading branch information
berendt committed Jun 6, 2014
1 parent da4137a commit e35b99c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -18,3 +18,4 @@ python-swiftclient>=1.6
python-keystoneclient>=0.4.2
PrettyTable>=0.6,<0.8
babel
six>=1.6.0
1 change: 0 additions & 1 deletion test-requirements.txt
Expand Up @@ -7,7 +7,6 @@ docutils==0.9.1
discover
fixtures>=0.3.14
python-subunit
six>=1.4.1
testrepository>=0.0.17
testtools>=0.9.32
sphinxcontrib-programoutput
3 changes: 2 additions & 1 deletion zuul/lib/swift.py
Expand Up @@ -17,6 +17,7 @@
from time import time
import os
import random
import six
import string
import swiftclient
import urlparse
Expand Down Expand Up @@ -116,7 +117,7 @@ def generate_form_post_middleware_params(self, destination_prefix='',
'file_path_prefix': ''
}

for key, default in settings.iteritems():
for key, default in six.iteritems(settings):
if key in kwargs:
settings[key] = kwargs[key]
elif self.config.has_option('swift', 'default_' + key):
Expand Down
4 changes: 3 additions & 1 deletion zuul/rpclistener.py
Expand Up @@ -19,6 +19,7 @@
import traceback

import gear
import six

import model

Expand Down Expand Up @@ -129,7 +130,8 @@ def handle_get_running_jobs(self, job):
# args = json.loads(job.arguments)
# TODO: use args to filter by pipeline etc
running_items = []
for pipeline_name, pipeline in self.sched.layout.pipelines.iteritems():
for pipeline_name, pipeline in six.iteritems(
self.sched.layout.pipelines):
for queue in pipeline.queues:
for item in queue.queue:
running_items.append(item.formatJSON())
Expand Down

0 comments on commit e35b99c

Please sign in to comment.