Skip to content
Snippets Groups Projects
Commit 87eb9bab authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Replace xrange() with range() in six.moves"

parents 66f5ac94 7f001265
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,7 @@ from oslo_config import cfg ...@@ -37,6 +37,7 @@ from oslo_config import cfg
from oslo_config import types from oslo_config import types
from requests.exceptions import ConnectionError from requests.exceptions import ConnectionError
import six import six
from six.moves import range
logging.basicConfig() logging.basicConfig()
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
...@@ -134,7 +135,7 @@ class WorkerThread(Thread): ...@@ -134,7 +135,7 @@ class WorkerThread(Thread):
while True: while True:
try: try:
image = self.queue.get() image = self.queue.get()
for _ in six.moves.range(self.conf.retries + 1): for _ in range(self.conf.retries + 1):
self.builder(image) self.builder(image)
if image['status'] in ['built', 'unmatched', if image['status'] in ['built', 'unmatched',
'parent_error']: 'parent_error']:
...@@ -757,12 +758,12 @@ def main(): ...@@ -757,12 +758,12 @@ def main():
queue = kolla.build_queue() queue = kolla.build_queue()
push_queue = six.moves.queue.Queue() push_queue = six.moves.queue.Queue()
for x in six.moves.xrange(conf.threads): for x in range(conf.threads):
worker = WorkerThread(queue, push_queue, conf) worker = WorkerThread(queue, push_queue, conf)
worker.setDaemon(True) worker.setDaemon(True)
worker.start() worker.start()
for x in six.moves.xrange(conf.push_threads): for x in range(conf.push_threads):
push_thread = PushThread(conf, push_queue) push_thread = PushThread(conf, push_queue)
push_thread.start() push_thread.start()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment