aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWanlong Gao <wanlong.gao@easystack.cn>2016-01-05 20:07:08 +0800
committerWanlong Gao <wanlong.gao@easystack.cn>2016-01-05 20:29:15 +0800
commit7f001265e74417256e4779f64e71e2ce3d832184 (patch)
treea92e2c84d76d75baca3f8d8a0bae87b7f238d814
parent7575ac4a4957ca7414a5bc7de3139608ccf3b44e (diff)
downloadkolla-7f001265e74417256e4779f64e71e2ce3d832184.tar.gz
kolla-7f001265e74417256e4779f64e71e2ce3d832184.zip
Replace xrange() with range() in six.moves
range maps to xrange() and range() in python2 and python3 respectively. TrivialFix Change-Id: I9b2477a17a570c3ce945badacbfa44889c0634a9
-rwxr-xr-xkolla/cmd/build.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py
index 476a8d2c3..cf20c72d3 100755
--- a/kolla/cmd/build.py
+++ b/kolla/cmd/build.py
@@ -37,6 +37,7 @@ from oslo_config import cfg
from oslo_config import types
from requests.exceptions import ConnectionError
import six
+from six.moves import range
logging.basicConfig()
LOG = logging.getLogger(__name__)
@@ -134,7 +135,7 @@ class WorkerThread(Thread):
while True:
try:
image = self.queue.get()
- for _ in six.moves.range(self.conf.retries + 1):
+ for _ in range(self.conf.retries + 1):
self.builder(image)
if image['status'] in ['built', 'unmatched',
'parent_error']:
@@ -757,12 +758,12 @@ def main():
queue = kolla.build_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.setDaemon(True)
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.start()