From 7c55ce4a5aee24008fb8ac4ae974987071678aeb Mon Sep 17 00:00:00 2001 From: Erno Kuvaja Date: Wed, 25 Feb 2015 12:12:43 +0000 Subject: [PATCH] Unify using six.moves.range rename everywhere Mainly to improve consistency, use range() from six.moves renames across glance. Behaves consistently like py2 xrange() and py3 range(). Change-Id: I542fcb2a762cf4b34c30fc796854c6fcf305d798 --- glance_store/_drivers/vmware_datastore.py | 2 ++ glance_store/common/auth.py | 2 ++ tests/unit/test_filesystem_store.py | 2 ++ tests/unit/test_swift_store.py | 2 ++ 4 files changed, 8 insertions(+) diff --git a/glance_store/_drivers/vmware_datastore.py b/glance_store/_drivers/vmware_datastore.py index 2ac2413d..f9788061 100644 --- a/glance_store/_drivers/vmware_datastore.py +++ b/glance_store/_drivers/vmware_datastore.py @@ -26,6 +26,8 @@ from oslo.vmware import constants from oslo_config import cfg from oslo_utils import excutils from oslo_utils import units +# NOTE(jokke): simplified transition to py3, behaves like py2 xrange +from six.moves import range import six.moves.urllib.parse as urlparse import glance_store diff --git a/glance_store/common/auth.py b/glance_store/common/auth.py index 76801cd4..790cb0b3 100644 --- a/glance_store/common/auth.py +++ b/glance_store/common/auth.py @@ -32,6 +32,8 @@ import httplib2 import logging from oslo.serialization import jsonutils +# NOTE(jokke): simplified transition to py3, behaves like py2 xrange +from six.moves import range import six.moves.urllib.parse as urlparse from glance_store import exceptions diff --git a/tests/unit/test_filesystem_store.py b/tests/unit/test_filesystem_store.py index f237a605..ac72e897 100644 --- a/tests/unit/test_filesystem_store.py +++ b/tests/unit/test_filesystem_store.py @@ -28,6 +28,8 @@ import uuid import fixtures from oslo_utils import units import six +# NOTE(jokke): simplified transition to py3, behaves like py2 xrange +from six.moves import range from glance_store._drivers.filesystem import ChunkedFile from glance_store._drivers.filesystem import Store diff --git a/tests/unit/test_swift_store.py b/tests/unit/test_swift_store.py index e5579477..1e38313b 100644 --- a/tests/unit/test_swift_store.py +++ b/tests/unit/test_swift_store.py @@ -28,6 +28,8 @@ from oslo_config import cfg from oslo_utils import units from oslotest import moxstubout import six +# NOTE(jokke): simplified transition to py3, behaves like py2 xrange +from six.moves import range import StringIO import swiftclient