From 3625acc1aaf7cf61b87e9905b54d6a13611e2fd0 Mon Sep 17 00:00:00 2001 From: Michael Beaver Date: Fri, 22 Mar 2019 11:38:11 -0500 Subject: [PATCH] Fix gate failures for Docker and Pep8 - Zuul updated ansible to 2.7, no longer uses missing variables. - Using an if to try and address. - Fixes a few formatting problems that are causing the gates to fail Docker fix based on Aaron Sheffield's PS for Pegleg: https://review.openstack.org/#/c/645631/ Change-Id: I14e8f3aac0af7a3abc4e2b6c4ece292a24bc4c6a --- armada/tests/unit/handlers/test_armada.py | 6 ++---- armada/tests/unit/handlers/test_tiller.py | 4 ++-- tools/gate/playbooks/docker-image-build.yaml | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/armada/tests/unit/handlers/test_armada.py b/armada/tests/unit/handlers/test_armada.py index b2c83257..2be30682 100644 --- a/armada/tests/unit/handlers/test_armada.py +++ b/armada/tests/unit/handlers/test_armada.py @@ -356,10 +356,8 @@ class ArmadaHandlerTestCase(base.ArmadaTestCase): if test_failure_to_run: def fail(tiller, release, timeout=None, cleanup=False): - status = AttrDict(**{ - 'info': - AttrDict(**{'Description': 'Failed'}) - }) + status = AttrDict( + **{'info': AttrDict(**{'Description': 'Failed'})}) raise tiller_exceptions.ReleaseException( release, status, 'Test') diff --git a/armada/tests/unit/handlers/test_tiller.py b/armada/tests/unit/handlers/test_tiller.py index d17e559b..96d37c37 100644 --- a/armada/tests/unit/handlers/test_tiller.py +++ b/armada/tests/unit/handlers/test_tiller.py @@ -535,8 +535,8 @@ class TillerTestCase(base.ArmadaTestCase): AttrDict( **{ 'status': - AttrDict(** - {'last_test_suite_run': test_suite_run}), + AttrDict( + **{'last_test_suite_run': test_suite_run}), 'Description': 'Failed' }) diff --git a/tools/gate/playbooks/docker-image-build.yaml b/tools/gate/playbooks/docker-image-build.yaml index 8a1b7898..d379d0c4 100644 --- a/tools/gate/playbooks/docker-image-build.yaml +++ b/tools/gate/playbooks/docker-image-build.yaml @@ -32,7 +32,7 @@ environment: BRANCH: "{{ zuul.branch }}" CHANGE: "{{ zuul.change }}" - COMMIT: "{{ zuul.newrev }}" + COMMIT: "{{ zuul.newrev | default('') }}" PATCHSET: "{{ zuul.patchset }}" register: image_tags @@ -116,7 +116,7 @@ DOCKER_REGISTRY: "quay.io" IMAGE_PREFIX: "airshipit" IMAGE_TAG: "{{ item }}" - COMMIT: "{{ zuul.newrev }}" + COMMIT: "{{ zuul.newrev | default('') }}" PUSH_IMAGE: "true" with_items: "{{ image_tags.stdout_lines }}"