diff --git a/jenkins/scripts/project-requirements-change.py b/jenkins/scripts/project-requirements-change.py index fb5ee431a9..ae90ad7607 100755 --- a/jenkins/scripts/project-requirements-change.py +++ b/jenkins/scripts/project-requirements-change.py @@ -119,7 +119,7 @@ def tempdir(): def install_and_load_requirements(reqroot, reqdir): sha = run_command("git --git-dir %s/.git rev-parse HEAD" % reqdir)[0] - print "requirements git sha: %s" % sha + print("requirements git sha: %s" % sha) req_venv = os.path.join(reqroot, 'venv') req_pip = os.path.join(req_venv, 'bin/pip') req_lib = os.path.join(req_venv, 'lib/python2.7/site-packages') @@ -168,8 +168,8 @@ def main(): "git://git.openstack.org " "openstack/requirements" % dict(zc=zc, root=reqroot)) - print out - print err + print(out) + print(err) else: reqdir = args.reqs diff --git a/jenkins/scripts/release-tools/launchpad_add_comment.py b/jenkins/scripts/release-tools/launchpad_add_comment.py index efd8a7f955..07636bd750 100755 --- a/jenkins/scripts/release-tools/launchpad_add_comment.py +++ b/jenkins/scripts/release-tools/launchpad_add_comment.py @@ -67,7 +67,7 @@ def main(): try: bug = launchpad.bugs[bugid] bug.newMessage(subject=args.subject, content=args.content) - print (" done.") + print(" done.") except lazr.restfulclient.errors.ServerError as e: print(" TIMEOUT during save !") except Exception as e: diff --git a/jenkins/scripts/tardiff.py b/jenkins/scripts/tardiff.py index cc90c4a5bf..76c0cbca4c 100755 --- a/jenkins/scripts/tardiff.py +++ b/jenkins/scripts/tardiff.py @@ -100,7 +100,7 @@ class OpenStackTarDiff: pass if len(self.missing_files) > 0: self.error("files missing in package: %s" % self.missing_files) - print "SUCCESS: Generated package '%s' is valid" % self.package + print("SUCCESS: Generated package '%s' is valid" % self.package) def get_project_name(self): """ get git project name """ diff --git a/test-requirements.txt b/test-requirements.txt index d1f248880a..d02dd5390b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1 @@ -hacking>=0.10,<0.11 -bashate>=0.2 -e git://git.openstack.org/openstack-infra/nodepool#egg=nodepool diff --git a/tools/check_valid_gerrit_projects.py b/tools/check_valid_gerrit_projects.py index 01631503df..3cfe7a99d5 100755 --- a/tools/check_valid_gerrit_projects.py +++ b/tools/check_valid_gerrit_projects.py @@ -42,7 +42,7 @@ def check_repo(repo_path): repo = git.Repo.clone_from(repo_path, repopath) remotes = repo.git.branch('--remote') branches = [r.strip() for r in remotes.splitlines() if r.strip()] - print (" Remote branches:") + print(" Remote branches:") for r in branches: print(" %s" % r) if 'origin/master' in branches: diff --git a/tools/ci2project.py b/tools/ci2project.py index b98915d778..4e1c8b3331 100644 --- a/tools/ci2project.py +++ b/tools/ci2project.py @@ -71,6 +71,6 @@ while not done: continue if value['name'] == 'Jenkins': continue - print "%s\t%s" % (change['project'], value['name']) + print("%s\t%s" % (change['project'], value['name'])) last_change = change done = not last_change.get('_more_changes', False) diff --git a/tox.ini b/tox.ini index 602babdd97..63bcd9d501 100644 --- a/tox.ini +++ b/tox.ini @@ -8,21 +8,7 @@ deps = -r{toxinidir}/test-requirements.txt passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY [testenv:linters] -commands = - {toxinidir}/tools/run-bashate.sh - flake8 - # Check that zuul.d/projects.yaml list is sorted - {toxinidir}/tools/zuul-projects_sorted.sh - -[testenv:ansible-linters] -# TODO(jaegerandi): merge this in linters job once it works fine -# zuul needs python3 basepython = python3 -deps = - # Zuul is required to supply the zuul ansible modules for ansible-lint - -egit+https://git.openstack.org/openstack-infra/zuul@feature/zuulv3#egg=zuul - ansible<2.4.0 - ansible-lint whitelist_externals = bash setenv = ANSIBLE_LIBRARY= {envdir}/src/zuul/zuul/ansible/library @@ -31,7 +17,20 @@ passenv = # to export ANSIBLE_ROLES_PATH pointing to the currect repos. # see infra-zuul-jobs-linters job for more information. ANSIBLE_ROLES_PATH +# Add dependencies here since other jobs use python2 and zuul requires +# python3. +deps = + # Zuul is required to supply the zuul ansible modules for ansible-lint + -egit+https://git.openstack.org/openstack-infra/zuul@feature/zuulv3#egg=zuul + ansible<2.4.0 + ansible-lint + hacking>=0.10,<0.11 + bashate>=0.2 commands = + {toxinidir}/tools/run-bashate.sh + flake8 + # Check that zuul.d/projects.yaml list is sorted + {toxinidir}/tools/zuul-projects_sorted.sh # Ansible lint # [ANSIBLE0012] Commands should not change things if nothing needs doing bash -c "find playbooks -type f -regex '.*.ya?ml' -print0 | \