From 11e51443b7658905397995012d993b60eeda22b2 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 23 Jul 2020 08:43:44 -0700 Subject: [PATCH] Add ensure-pip to python release pre-run playbook This is required in order to avoid this error: ModuleNotFoundError: No module named 'setuptools' The version of ansible-lint we were using has a bug which causes a false positive on ensure-pip, so we update the ansible-lint version to match that in zuul-jobs and update the skips accordingly. This also flags lack of spaces in {{braces}} so those instances are fixed. Change-Id: I9d122631126ab65507f0a5616ff6741066a7acf8 --- .ansible-lint | 3 +++ playbooks/artifacts/promote-deployment.yaml | 2 +- playbooks/artifacts/promote.yaml | 4 ++-- playbooks/release-python/pre.yaml | 1 + test-requirements.txt | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 2d88cc7..a462b8a 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -3,3 +3,6 @@ parseable: true skip_list: # [ANSIBLE0012] Commands should not change things if nothing needs doing - ANSIBLE0012 + - '106' # Role name does not match ``^[a-z][a-z0-9_]+$`` pattern + - '204' # Lines should be no longer than 160 chars + - '701' # No 'galaxy_info' found diff --git a/playbooks/artifacts/promote-deployment.yaml b/playbooks/artifacts/promote-deployment.yaml index 53b0118..5fa9dc7 100644 --- a/playbooks/artifacts/promote-deployment.yaml +++ b/playbooks/artifacts/promote-deployment.yaml @@ -42,7 +42,7 @@ unarchive: src: "{{ item.path }}" dest: "{{ src_dir }}" - loop: "{{files.files}}" + loop: "{{ files.files }}" - name: Upload to AFS synchronize: delete: yes diff --git a/playbooks/artifacts/promote.yaml b/playbooks/artifacts/promote.yaml index 8f468d3..70c1382 100644 --- a/playbooks/artifacts/promote.yaml +++ b/playbooks/artifacts/promote.yaml @@ -2,7 +2,7 @@ vars: name_replacement: '.*?(-py.*?\.whl|\.tar\.gz)' name_extra: "{{ (artifact_extra_name|default('') and '-'+artifact_extra_name or '') | regex_replace('[^a-zA-z1-9_\\-.]', '') }}" - name_target: "{{zuul.project.short_name}}{{ name_extra }}-{{zuul.branch | replace('/', '-')}}\\1" + name_target: "{{ zuul.project.short_name }}{{ name_extra }}-{{ zuul.branch | replace('/', '-') }}\\1" tasks: - name: Check execution context when: "zuul.branch is not defined" @@ -38,7 +38,7 @@ - name: Upload to AFS command: "cp {{ item.path }} {{ target_dir }}/{{ item.path | basename | regex_replace(name_replacement, name_target) }}" when: "item.path is match(name_replacement)" - loop: "{{files.files}}" + loop: "{{ files.files }}" - name: Destroy AFS token include_role: name: destroy-afs-token diff --git a/playbooks/release-python/pre.yaml b/playbooks/release-python/pre.yaml index dc935e7..cd0ea26 100644 --- a/playbooks/release-python/pre.yaml +++ b/playbooks/release-python/pre.yaml @@ -1,3 +1,4 @@ - hosts: all roles: - bindep + - ensure-pip diff --git a/test-requirements.txt b/test-requirements.txt index c6ca123..4f0bc83 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -13,7 +13,7 @@ zuul # ansible-lint pull in the latest version. ansible>=2.5.1,<2.6 # https://review.openstack.org/567007 # We need to pin ansible-lint to before 4.0 which blows up all over the place -ansible-lint<4 +ansible-lint>=4.3.0a1,<5 bashate>=0.2 zuul-sphinx>=0.1.1 stestr>=1.0.0 # Apache-2.0