diff --git a/.zuul.yaml b/.zuul.yaml index f37bdeb71..dbe33dc2e 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -95,19 +95,17 @@ description: | Run shade functional tests against a master devstack vars: - python_version: 2.7 devstack_localrc: Q_SERVICE_PLUGIN_CLASSES: qos Q_ML2_PLUGIN_EXT_DRIVERS: qos,port_security + tox_environment: + SHADE_TOX_PYTHON: python3 - job: name: shade-functional-devstack-python3 parent: shade-functional-devstack description: | Run shade functional tests using python3 against a master devstack - vars: - shade_environment: - SHADE_TOX_PYTHON: python3 - job: name: shade-functional-devstack-tips-python3 @@ -207,11 +205,9 @@ - shade-ansible-stable-2.5-functional-devstack: voting: false - shade-ansible-functional-devstack - - shade-functional-devstack - shade-functional-devstack-magnum - shade-functional-devstack-python3 gate: jobs: - shade-ansible-functional-devstack - - shade-functional-devstack - shade-functional-devstack-python3 diff --git a/shade/openstackcloud.py b/shade/openstackcloud.py index 0c98e0bd2..51ee36f0e 100644 --- a/shade/openstackcloud.py +++ b/shade/openstackcloud.py @@ -5102,7 +5102,7 @@ class OpenStackCloud( if not img_props: return False self._image_client.put( - '/images/{id}'.format(image.id), headers=img_props) + '/images/{id}'.format(id=image.id), headers=img_props) self.list_images.invalidate(self) return True @@ -11466,7 +11466,7 @@ class OpenStackCloud( proj = self.get_project(name_or_id) if not proj: raise exc.OpenStackCloudException( - "project does not exist: {}".format(name=proj.id)) + "project does not exist: {name}".format(name=proj.id)) data = self._compute_client.get( '/os-simple-tenant-usage/{project}'.format(project=proj.id), diff --git a/shade/tests/unit/test_image.py b/shade/tests/unit/test_image.py index dae58a56f..4e1a6904b 100644 --- a/shade/tests/unit/test_image.py +++ b/shade/tests/unit/test_image.py @@ -305,7 +305,7 @@ class TestImage(BaseTestImage): 'X-Timestamp': '1481912480.41664', 'X-Trans-Id': 'tx60ec128d9dbf44b9add68-0058543271dfw1', # noqa 'X-Container-Bytes-Used': '0', - 'Content-Type': 'text/plain; charset=utf-8'}), + 'Content-Type': 'text/plain; charset=utf-8'}), dict(method='HEAD', uri='{endpoint}/{container}/{object}'.format( endpoint=endpoint, container=self.container_name, diff --git a/shade/tests/unit/test_network.py b/shade/tests/unit/test_network.py index b59034764..0f56d1323 100644 --- a/shade/tests/unit/test_network.py +++ b/shade/tests/unit/test_network.py @@ -1,4 +1,4 @@ -# Licensed under the Apache License, Version 2.0 (the 'License'); +# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # diff --git a/shade/tests/unit/test_object.py b/shade/tests/unit/test_object.py index 54fb65b6e..7ea8697ed 100644 --- a/shade/tests/unit/test_object.py +++ b/shade/tests/unit/test_object.py @@ -643,7 +643,6 @@ class TestObjectUploads(BaseTestObject): 'header mismatch in manifest call') base_object = '/{container}/{object}'.format( - endpoint=self.endpoint, container=self.container, object=self.object) @@ -864,7 +863,6 @@ class TestObjectUploads(BaseTestObject): 'header mismatch in manifest call') base_object = '/{container}/{object}'.format( - endpoint=self.endpoint, container=self.container, object=self.object) diff --git a/shade/tests/unit/test_security_groups.py b/shade/tests/unit/test_security_groups.py index e3485c8fa..658d5cf26 100644 --- a/shade/tests/unit/test_security_groups.py +++ b/shade/tests/unit/test_security_groups.py @@ -582,8 +582,7 @@ class TestSecurityGroups(base.RequestsMockTestCase): dict( method='GET', uri='{endpoint}/os-security-groups'.format( - endpoint=fakes.COMPUTE_ENDPOINT, - id='server_id'), + endpoint=fakes.COMPUTE_ENDPOINT), json={'security_groups': [nova_grp_dict]}), dict( method='POST', diff --git a/shade/tests/unit/test_stack.py b/shade/tests/unit/test_stack.py index bc3380c22..f21b0f743 100644 --- a/shade/tests/unit/test_stack.py +++ b/shade/tests/unit/test_stack.py @@ -225,7 +225,7 @@ class TestStack(base.RequestsMockTestCase): dict(method='GET', uri='{endpoint}/stacks/{id}?{resolve}'.format( endpoint=fakes.ORCHESTRATION_ENDPOINT, - id=self.stack_id, name=self.stack_name, resolve=resolve), + id=self.stack_id, resolve=resolve), status_code=404), ]) @@ -281,7 +281,7 @@ class TestStack(base.RequestsMockTestCase): dict(method='GET', uri='{endpoint}/stacks/{id}?resolve_outputs=False'.format( endpoint=fakes.ORCHESTRATION_ENDPOINT, - id=self.stack_id, name=self.stack_name), + id=self.stack_id), status_code=302, headers=dict( location='{endpoint}/stacks/{name}/{id}?{resolve}'.format( diff --git a/tox.ini b/tox.ini index 27579de3a..40766bc66 100644 --- a/tox.ini +++ b/tox.ini @@ -19,8 +19,16 @@ deps = commands = stestr run {posargs} stestr slowest +[testenv:py27] +deps = + # Upper-constraints does not work with py27 anymore, let's + # use lower-constraints for this test. + -c{toxinidir}/lower-constraints.txt + -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + [testenv:functional] -basepython = {env:SHADE_TOX_PYTHON:python2} +basepython = {env:SHADE_TOX_PYTHON:python3} passenv = OS_* SHADE_* UPPER_CONSTRAINTS_FILE commands = stestr --test-path ./shade/tests/functional run --serial {posargs} stestr slowest @@ -32,7 +40,7 @@ skip_install = True deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} doc8 - hacking>=2.0,<3 + hacking>=3.1.0,<3.2.0 pygments commands = doc8 doc/source @@ -97,7 +105,8 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen # H4 Are about docstrings - and there's just too many of them to fix # W503 Is supposed to be off by default but a bug has it on by default. It's # also a categorially terrible idea and Donald Knuth agrees with me. -ignore = H103,H306,H4,W503,W504 +# E741 ambiguous variable name 'l' +ignore = H103,H306,H4,W503,W504,E741 show-source = True builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build