Skip to content

Commit 80b807a

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Remove six.moves"
2 parents be752b8 + 1d0a0e8 commit 80b807a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+126
-163
lines changed

doc/ext/feature_matrix.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020
2121
"""
2222

23+
import configparser
2324
import re
2425
import sys
2526

26-
from six.moves import configparser
27-
2827
from docutils import nodes
2928
from docutils.parsers import rst
3029

nova/api/metadata/password.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# License for the specific language governing permissions and limitations
1414
# under the License.
1515

16-
from six.moves import range
1716
from webob import exc
1817

1918
import nova.conf

nova/api/openstack/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
import collections
1717
import itertools
1818
import re
19+
from urllib import parse as urlparse
1920

2021
from oslo_log import log as logging
2122
from oslo_utils import strutils
2223
import six
23-
import six.moves.urllib.parse as urlparse
2424
import webob
2525
from webob import exc
2626

nova/api/openstack/compute/quota_sets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# License for the specific language governing permissions and limitations
1414
# under the License.
1515

16-
from oslo_utils import strutils
16+
from urllib import parse as urlparse
1717

18-
import six.moves.urllib.parse as urlparse
18+
from oslo_utils import strutils
1919
import webob
2020

2121
from nova.api.openstack.api_version_request \

nova/api/openstack/compute/simple_tenant_usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
import collections
1717
import datetime
18+
from urllib import parse as urlparse
1819

1920
import iso8601
2021
from oslo_utils import timeutils
2122
import six
22-
import six.moves.urllib.parse as urlparse
2323
from webob import exc
2424

2525
from nova.api.openstack import common

nova/cmd/manage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import re
2727
import sys
2828
import traceback
29+
from urllib import parse as urlparse
2930

3031
from dateutil import parser as dateutil_parser
3132
from keystoneauth1 import exceptions as ks_exc
@@ -40,7 +41,6 @@
4041
from oslo_utils import uuidutils
4142
import prettytable
4243
import six
43-
import six.moves.urllib.parse as urlparse
4444
from sqlalchemy.engine import url as sqla_url
4545

4646
from nova.cmd import common as cmd_common

nova/compute/api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
from oslo_utils import units
3636
from oslo_utils import uuidutils
3737
import six
38-
from six.moves import range
3938

4039
from nova.accelerator import cyborg
4140
from nova import availability_zones

nova/compute/manager.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
from oslo_utils import timeutils
5656
from oslo_utils import units
5757
import six
58-
from six.moves import range
5958

6059
from nova.accelerator import cyborg
6160
from nova import block_device

nova/conductor/manager.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ def build_instances(self, context, instances, image, filter_properties,
702702
return
703703

704704
elevated = context.elevated()
705-
for (instance, host_list) in six.moves.zip(instances, host_lists):
705+
for (instance, host_list) in zip(instances, host_lists):
706706
host = host_list.pop(0)
707707
if is_reschedule:
708708
# If this runs in the superconductor, the first instance will
@@ -1523,7 +1523,7 @@ def schedule_and_build_instances(self, context, build_requests,
15231523
instances = []
15241524
host_az = {} # host=az cache to optimize multi-create
15251525

1526-
for (build_request, request_spec, host_list) in six.moves.zip(
1526+
for (build_request, request_spec, host_list) in zip(
15271527
build_requests, request_specs, host_lists):
15281528
instance = build_request.get_new_instance(context)
15291529
# host_list is a list of one or more Selection objects, the first
@@ -1605,8 +1605,7 @@ def schedule_and_build_instances(self, context, build_requests,
16051605
block_device_mapping, tags,
16061606
cell_mapping_cache)
16071607

1608-
zipped = six.moves.zip(build_requests, request_specs, host_lists,
1609-
instances)
1608+
zipped = zip(build_requests, request_specs, host_lists, instances)
16101609
for (build_request, request_spec, host_list, instance) in zipped:
16111610
if instance is None:
16121611
# Skip placeholders that were buried in cell0 or had their
@@ -1758,7 +1757,7 @@ def _map_instance_to_cell(context, instance, cell):
17581757
def _cleanup_build_artifacts(self, context, exc, instances, build_requests,
17591758
request_specs, block_device_mappings, tags,
17601759
cell_mapping_cache):
1761-
for (instance, build_request, request_spec) in six.moves.zip(
1760+
for (instance, build_request, request_spec) in zip(
17621761
instances, build_requests, request_specs):
17631762
# Skip placeholders that were buried in cell0 or had their
17641763
# build requests deleted by the user before instance create.

nova/console/serial.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import socket
1818

1919
from oslo_log import log as logging
20-
import six.moves
2120

2221
import nova.conf
2322
from nova import exception
@@ -45,7 +44,7 @@ def acquire_port(host):
4544

4645
start, stop = _get_port_range()
4746

48-
for port in six.moves.range(start, stop):
47+
for port in range(start, stop):
4948
if (host, port) in ALLOCATED_PORTS:
5049
continue
5150
try:

nova/console/websocketproxy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
'''
2020

2121
import copy
22+
from http import cookies as Cookie
2223
import socket
2324
import sys
25+
from urllib import parse as urlparse
2426

2527
from oslo_log import log as logging
2628
from oslo_utils import encodeutils
2729
from oslo_utils import importutils
2830
import six
29-
from six.moves import http_cookies as Cookie
30-
import six.moves.urllib.parse as urlparse
3131
import websockify
3232

3333
from nova.compute import rpcapi as compute_rpcapi

nova/db/sqlalchemy/api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
from oslo_utils import timeutils
3636
from oslo_utils import uuidutils
3737
import six
38-
from six.moves import range
3938
import sqlalchemy as sa
4039
from sqlalchemy import and_
4140
from sqlalchemy import Boolean

nova/image/glance.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
from oslo_utils import excutils
4141
from oslo_utils import timeutils
4242
import six
43-
from six.moves import range
4443

4544
import nova.conf
4645
from nova import exception

nova/network/security_group_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# License for the specific language governing permissions and limitations
1818
# under the License.
1919

20+
import urllib
21+
2022
import netaddr
2123
from neutronclient.common import exceptions as n_exc
2224
from neutronclient.neutron import v2_0 as neutronv20
@@ -26,7 +28,6 @@
2628
from oslo_utils import netutils
2729
from oslo_utils import uuidutils
2830
import six
29-
from six.moves import urllib
3031
from webob import exc
3132

3233
from nova import context as nova_context

nova/objects/cell_mapping.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212

13+
from urllib import parse as urlparse
14+
1315
from oslo_log import log as logging
1416
from oslo_utils import versionutils
15-
import six.moves.urllib.parse as urlparse
1617
from sqlalchemy.sql.expression import asc
1718
from sqlalchemy.sql import false
1819
from sqlalchemy.sql import true

nova/objects/console_auth_token.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
# License for the specific language governing permissions and limitations
1414
# under the License.
1515

16+
from urllib import parse as urlparse
17+
1618
from oslo_db.exception import DBDuplicateEntry
1719
from oslo_log import log as logging
1820
from oslo_utils import strutils
1921
from oslo_utils import timeutils
2022
from oslo_utils import uuidutils
21-
import six.moves.urllib.parse as urlparse
2223

2324
from nova.db import api as db
2425
from nova import exception

nova/scheduler/filter_scheduler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import random
2323

2424
from oslo_log import log as logging
25-
from six.moves import range
2625

2726
from nova.compute import utils as compute_utils
2827
import nova.conf

nova/scheduler/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
import collections
1818
import re
1919
import sys
20+
from urllib import parse
2021

2122
import os_resource_classes as orc
2223
import os_traits
2324
from oslo_log import log as logging
2425
from oslo_serialization import jsonutils
25-
from six.moves.urllib import parse
2626

2727
from nova.compute import flavors
2828
from nova.compute import utils as compute_utils

nova/storage/rbd_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
1616

17+
import urllib
18+
1719
from eventlet import tpool
18-
from six.moves import urllib
1920

2021
from oslo_concurrency import processutils
2122
from oslo_log import log as logging

nova/test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import nova.monkey_patch # noqa
2525

2626
import abc
27+
import builtins
2728
import collections
2829
import contextlib
2930
import copy
@@ -50,7 +51,6 @@
5051
from oslotest import base
5152
from oslotest import mock_fixture
5253
import six
53-
from six.moves import builtins
5454
import testtools
5555

5656
from nova.compute import rpcapi as compute_rpcapi
@@ -903,7 +903,7 @@ def patch_open(patched_path, read_data):
903903
selective patching based on the path. In this case something like
904904
like this may be more appropriate:
905905
906-
@mock.patch(six.moves.builtins, 'open')
906+
@mock.patch('builtins.open')
907907
def test_my_code(self, mock_open):
908908
...
909909
mock_open.assert_called_once_with(path)
@@ -916,6 +916,6 @@ def selective_fake_open(path, *args, **kwargs):
916916
return m(patched_path)
917917
return real_open(path, *args, **kwargs)
918918

919-
with mock.patch.object(builtins, 'open') as mock_open:
919+
with mock.patch('builtins.open') as mock_open:
920920
mock_open.side_effect = selective_fake_open
921921
yield m

nova/tests/functional/api/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15+
from urllib import parse
16+
1517
from oslo_log import log as logging
1618
from oslo_serialization import jsonutils
1719
import requests
18-
from six.moves.urllib import parse
1920

2021

2122
LOG = logging.getLogger(__name__)

nova/tests/functional/api_sample_tests/test_instance_usage_audit_log.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
# under the License.
1515

1616
from datetime import datetime
17-
18-
from six.moves import urllib
17+
import urllib
1918

2019
from nova import context
2120
from nova import objects

nova/tests/functional/api_sample_tests/test_simple_tenant_usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
# under the License.
1414

1515
import datetime
16+
from urllib import parse
1617

1718
import mock
1819
from oslo_utils import timeutils
19-
from six.moves.urllib import parse
2020

2121
from nova.tests.functional.api_sample_tests import test_servers
2222
import nova.tests.functional.api_samples_test_base as astb

nova/tests/functional/test_nova_manage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212
import collections
13+
from io import StringIO
1314
import mock
1415

1516
import fixtures
1617
from neutronclient.common import exceptions as neutron_client_exc
1718
import os_resource_classes as orc
1819
from oslo_utils.fixture import uuidsentinel
19-
from six.moves import StringIO
2020

2121
from nova.cmd import manage
2222
from nova import config

nova/tests/unit/api/openstack/compute/test_flavors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
# License for the specific language governing permissions and limitations
1414
# under the License.
1515

16+
from urllib import parse as urlparse
17+
1618
import mock
17-
import six.moves.urllib.parse as urlparse
1819
import webob
1920

2021
from nova.api.openstack import common

nova/tests/unit/api/openstack/compute/test_images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"""
2020

2121
import copy
22+
from urllib import parse as urlparse
2223

2324
import mock
24-
import six.moves.urllib.parse as urlparse
2525
import webob
2626

2727
from nova.api.openstack.compute import images as images_v21

nova/tests/unit/api/openstack/compute/test_limits.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
Tests dealing with HTTP rate-limiting.
1818
"""
1919

20+
from http import client as httplib
21+
from io import StringIO
22+
2023
import mock
2124
from oslo_serialization import jsonutils
2225
from oslo_utils import encodeutils
23-
from six.moves import http_client as httplib
24-
from six.moves import StringIO
2526

2627
from nova.api.openstack.compute import limits as limits_v21
2728
from nova.api.openstack.compute import views

nova/tests/unit/api/openstack/compute/test_servers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import datetime
2020
import ddt
2121
import functools
22+
from urllib import parse as urlparse
2223

2324
import fixtures
2425
import iso8601
@@ -32,8 +33,6 @@
3233
from oslo_utils import timeutils
3334
from oslo_utils import uuidutils
3435
import six
35-
from six.moves import range
36-
import six.moves.urllib.parse as urlparse
3736
import testtools
3837
import webob
3938

0 commit comments

Comments
 (0)