diff --git a/ec2api_tempest_plugin/scenario/test_paging.py b/ec2api_tempest_plugin/scenario/test_paging.py index 9aaa0e9..e01f20f 100644 --- a/ec2api_tempest_plugin/scenario/test_paging.py +++ b/ec2api_tempest_plugin/scenario/test_paging.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from six.moves import range import time import botocore.exceptions @@ -48,7 +49,7 @@ class TagsPagingTest(scenario_base.BaseScenarioTest): self.get_volume_waiter().wait_available(volume_id) keys = list() - for dummy in xrange(0, self.TAGS_COUNT): + for dummy in range(0, self.TAGS_COUNT): key = data_utils.rand_name('key') value = 'aaa' if dummy < 6 else 'bbb' data = self.client.create_tags(Resources=[volume_id], @@ -167,7 +168,7 @@ class VolumesPagingTest(scenario_base.BaseScenarioTest): zone = CONF.aws.aws_zone cls.ids = list() - for dummy in xrange(0, cls.VOLUMES_COUNT): + for dummy in range(0, cls.VOLUMES_COUNT): data = cls.client.create_volume(Size=1, AvailabilityZone=zone) volume_id = data['VolumeId'] cls.addResourceCleanUpStatic(cls.client.delete_volume, @@ -338,7 +339,7 @@ class InstancePagingTest(scenario_base.BaseScenarioTest): 'MinCount': cls.INSTANCES_IN_RESERVATIONS_COUNT, 'MaxCount': cls.INSTANCES_IN_RESERVATIONS_COUNT } - for dummy in xrange(0, cls.RESERVATIONS_COUNT): + for dummy in range(0, cls.RESERVATIONS_COUNT): data = cls.client.run_instances(*[], **kwargs) for instance in data['Instances']: cls.ids.append(instance['InstanceId']) diff --git a/ec2api_tempest_plugin/scenario/test_vpn.py b/ec2api_tempest_plugin/scenario/test_vpn.py index 6263a0c..64a6bf4 100644 --- a/ec2api_tempest_plugin/scenario/test_vpn.py +++ b/ec2api_tempest_plugin/scenario/test_vpn.py @@ -14,6 +14,7 @@ # under the License. import os +import six import sys import time import urllib2 @@ -162,7 +163,7 @@ class VpnTest(scenario_base.BaseScenarioTest): LOG.warning(output) except Exception: pass - raise exc_info[1], None, exc_info[2] + six.reraise(exc_info[1], None, exc_info[2]) time.sleep(10) ssh_client.exec_command('ping -c 4 %s' % private_ip_in_vpc) diff --git a/tox.ini b/tox.ini index 05b611b..b9e9204 100644 --- a/tox.ini +++ b/tox.ini @@ -26,9 +26,11 @@ commands = rm -f .testrepository/times.dbm [testenv:pep8] +basepython = python3 commands = flake8 {posargs} [testenv:venv] +basepython = python3 commands = {posargs} [testenv:debug] @@ -40,7 +42,7 @@ commands = oslo_debug_helper {posargs} show-source = True ignore = E122,E123,E125,E126,E127,E128 builtins = _ -# H106: Don’t put vim configuration in source files +# H106: Don't put vim configuration in source files # H203: Use assertIs(Not)None to check for None enable-extensions=H106,H203 exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build