From f76cfbab11fb8729f6ff7ce4dd642e9a70bd6c74 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 26 Jul 2022 20:10:22 +1000 Subject: [PATCH] linters: fix spaces between filters This fixes a number of places where we do not have spaces between filters. I think that this is a reasonable rule for readability (I also think it probably was enforced, but maybe later versions got better at detecting it?). These are detected by a later version of Ansible lint; this change should have no operational change to any roles but prepares us to update in a follow-on change. Change-Id: I07e1a109b87adce86f483d14d7e02fcecb8313d5 --- roles/add-fileserver/tasks/main.yaml | 4 ++-- roles/ansible-galaxy-import/defaults/main.yaml | 2 +- roles/build-container-image/tasks/build.yaml | 2 +- roles/configure-mirrors/defaults/main.yaml | 2 +- roles/emit-job-header/tasks/main.yaml | 4 ++-- roles/ensure-babel/tasks/main.yaml | 2 +- roles/ensure-ghc/tasks/main.yaml | 4 ++-- roles/ensure-if-python/tasks/main.yaml | 2 +- roles/ensure-javascript-packages/tasks/main.yaml | 2 +- roles/fetch-javascript-tarball/defaults/main.yaml | 2 +- roles/fetch-sphinx-output/defaults/main.yaml | 2 +- roles/fetch-sphinx-tarball/defaults/main.yaml | 2 +- roles/fetch-subunit-output/defaults/main.yaml | 2 +- roles/fetch-tox-output/defaults/main.yaml | 2 +- roles/fetch-translation-output/defaults/main.yaml | 2 +- roles/find-constraints/tasks/main.yaml | 4 ++-- roles/intercept-job/tasks/wait.yaml | 4 ++-- roles/markdownlint/tasks/main.yaml | 4 ++-- roles/phoronix-combine-results/tasks/fetch-result.yaml | 4 ++-- roles/stage-output/tasks/main.yaml | 2 +- roles/tox/tasks/main.yaml | 2 +- roles/tox/tasks/siblings.yaml | 4 ++-- roles/upload-artifactory/tasks/upload.yaml | 4 ++-- roles/upload-npm/defaults/main.yaml | 2 +- roles/upload-pypi/defaults/main.yaml | 4 ++-- roles/validate-host/tasks/main.yaml | 10 +++++----- 26 files changed, 40 insertions(+), 40 deletions(-) diff --git a/roles/add-fileserver/tasks/main.yaml b/roles/add-fileserver/tasks/main.yaml index 584bb8454..89e8b4c36 100644 --- a/roles/add-fileserver/tasks/main.yaml +++ b/roles/add-fileserver/tasks/main.yaml @@ -18,8 +18,8 @@ - name: Add fileserver to inventory add_host: name: "{{ fileserver.fqdn }}" - ansible_user: "{{ fileserver.ssh_username|default(ansible_user) }}" - zuul_fileserver_project_path: "{{ fileserver.path }}{{ '/' + fileserver_leading_path if fileserver_leading_path is defined else ''}}/{{ zuul.project.short_name }}" + ansible_user: "{{ fileserver.ssh_username | default(ansible_user) }}" + zuul_fileserver_project_path: "{{ fileserver.path }}{{ '/' + fileserver_leading_path if fileserver_leading_path is defined else '' }}/{{ zuul.project.short_name }}" - name: Add fileserver server to known hosts known_hosts: diff --git a/roles/ansible-galaxy-import/defaults/main.yaml b/roles/ansible-galaxy-import/defaults/main.yaml index 51c8869a7..89a47fca8 100644 --- a/roles/ansible-galaxy-import/defaults/main.yaml +++ b/roles/ansible-galaxy-import/defaults/main.yaml @@ -1,4 +1,4 @@ --- ansible_galaxy_branch: "{{ zuul.branch }}" ansible_galaxy_executable: ansible-galaxy -ansible_galaxy_server: "{{ ansible_galaxy_info.server|default('https://galaxy.ansible.com') }}" +ansible_galaxy_server: "{{ ansible_galaxy_info.server | default('https://galaxy.ansible.com') }}" diff --git a/roles/build-container-image/tasks/build.yaml b/roles/build-container-image/tasks/build.yaml index 36dd384a6..37ebbfb15 100644 --- a/roles/build-container-image/tasks/build.yaml +++ b/roles/build-container-image/tasks/build.yaml @@ -27,7 +27,7 @@ - name: Set container filename arg set_fact: - containerfile: "{{ zj_image.container_filename|default(container_filename)|default('') }}" + containerfile: "{{ zj_image.container_filename | default(container_filename) | default('') }}" - name: Build a container image vars: diff --git a/roles/configure-mirrors/defaults/main.yaml b/roles/configure-mirrors/defaults/main.yaml index cd30c3cf7..33abb4a71 100644 --- a/roles/configure-mirrors/defaults/main.yaml +++ b/roles/configure-mirrors/defaults/main.yaml @@ -1,5 +1,5 @@ set_apt_mirrors_trusted: False -mirror_fqdn: "{{ zuul_site_mirror_fqdn|default(omit) }}" +mirror_fqdn: "{{ zuul_site_mirror_fqdn | default(omit) }}" pypi_fqdn: "{{ mirror_fqdn }}" mirror_use_ssl: False http_or_https: >- diff --git a/roles/emit-job-header/tasks/main.yaml b/roles/emit-job-header/tasks/main.yaml index 3d429f503..57d277117 100644 --- a/roles/emit-job-header/tasks/main.yaml +++ b/roles/emit-job-header/tasks/main.yaml @@ -28,8 +28,8 @@ msg: | # Node Information Inventory Hostname: {{ zj_item }} - Hostname: {{ hostvars[zj_item]['ansible_hostname']|default('unknown') }} - Username: {{ hostvars[zj_item]['ansible_user']|default('unknown') }} + Hostname: {{ hostvars[zj_item]['ansible_hostname'] | default('unknown') }} + Username: {{ hostvars[zj_item]['ansible_user'] | default('unknown') }} Distro: {{ hostvars[zj_item]['ansible_distribution'] | default('unknown') }} {{ hostvars[zj_item]['ansible_distribution_version'] | default('unknown') }} Provider: {{ hostvars[zj_item]['nodepool']['provider'] }} Label: {{ hostvars[zj_item]['nodepool']['label'] }} diff --git a/roles/ensure-babel/tasks/main.yaml b/roles/ensure-babel/tasks/main.yaml index aa116a591..28ce7d995 100644 --- a/roles/ensure-babel/tasks/main.yaml +++ b/roles/ensure-babel/tasks/main.yaml @@ -33,4 +33,4 @@ - lxml - requests virtualenv: "{{ ansible_user_dir }}/.venv" - extra_args: "{{ upper_constraints|default(omit) }}" + extra_args: "{{ upper_constraints | default(omit) }}" diff --git a/roles/ensure-ghc/tasks/main.yaml b/roles/ensure-ghc/tasks/main.yaml index e3dbe1aa4..f71721b1c 100644 --- a/roles/ensure-ghc/tasks/main.yaml +++ b/roles/ensure-ghc/tasks/main.yaml @@ -19,7 +19,7 @@ - name: Install ghc dnf: - name: "@ghc:{{ ghc_versions[ghc_version]|string }}" + name: "@ghc:{{ ghc_versions[ghc_version] | string }}" state: present become: yes - when: "_ghc_version.rc != 0 or (ghc_versions[ghc_version]|string) not in _ghc_version.stdout" + when: "_ghc_version.rc != 0 or (ghc_versions[ghc_version] | string) not in _ghc_version.stdout" diff --git a/roles/ensure-if-python/tasks/main.yaml b/roles/ensure-if-python/tasks/main.yaml index 9719d8aad..a139dc2ad 100644 --- a/roles/ensure-if-python/tasks/main.yaml +++ b/roles/ensure-if-python/tasks/main.yaml @@ -30,7 +30,7 @@ chdir: "{{ zuul_work_dir }}" virtualenv: "{{ zuul_work_virtualenv }}" requirements: requirements.txt - extra_args: "{{ upper_constraints|default(omit) }}" + extra_args: "{{ upper_constraints | default(omit) }}" register: requirements_install when: - install_package diff --git a/roles/ensure-javascript-packages/tasks/main.yaml b/roles/ensure-javascript-packages/tasks/main.yaml index d96fe65eb..05c9f3e1e 100644 --- a/roles/ensure-javascript-packages/tasks/main.yaml +++ b/roles/ensure-javascript-packages/tasks/main.yaml @@ -44,7 +44,7 @@ - name: Install npm dependencies command: npm install --verbose - environment: "{{ npm_environment|combine(tox_constraints_env|default({})) }}" + environment: "{{ npm_environment | combine(tox_constraints_env | default({})) }}" args: chdir: "{{ zuul_work_dir }}" when: js_build_tool == 'npm' diff --git a/roles/fetch-javascript-tarball/defaults/main.yaml b/roles/fetch-javascript-tarball/defaults/main.yaml index 3de4191ec..d3fb069f9 100644 --- a/roles/fetch-javascript-tarball/defaults/main.yaml +++ b/roles/fetch-javascript-tarball/defaults/main.yaml @@ -1,3 +1,3 @@ zuul_work_dir: "{{ zuul.project.src_dir }}" zuul_output_dir: "{{ ansible_user_dir }}/zuul-output" -zuul_use_fetch_output: "{{ zuul_site_use_fetch_output|default(false) }}" +zuul_use_fetch_output: "{{ zuul_site_use_fetch_output | default(false) }}" diff --git a/roles/fetch-sphinx-output/defaults/main.yaml b/roles/fetch-sphinx-output/defaults/main.yaml index c9ba69c11..7396c6a8d 100644 --- a/roles/fetch-sphinx-output/defaults/main.yaml +++ b/roles/fetch-sphinx-output/defaults/main.yaml @@ -2,7 +2,7 @@ zuul_executor_dest: "{{ zuul.executor.log_root }}" zuul_work_dir: "{{ zuul.project.src_dir }}" zuul_output_dir: "{{ ansible_user_dir }}/zuul-output" -zuul_use_fetch_output: "{{ zuul_site_use_fetch_output|default(false) }}" +zuul_use_fetch_output: "{{ zuul_site_use_fetch_output | default(false) }}" sphinx_build_dir: doc/build sphinx_output_suffix: "" sphinx_output_src: "{{ zuul_work_dir }}/{{ sphinx_build_dir }}/html{{ sphinx_output_suffix }}" diff --git a/roles/fetch-sphinx-tarball/defaults/main.yaml b/roles/fetch-sphinx-tarball/defaults/main.yaml index b9b0bb05e..1358764e0 100644 --- a/roles/fetch-sphinx-tarball/defaults/main.yaml +++ b/roles/fetch-sphinx-tarball/defaults/main.yaml @@ -1,7 +1,7 @@ --- zuul_work_dir: "{{ zuul.project.src_dir }}" zuul_output_dir: "{{ ansible_user_dir }}/zuul-output" -zuul_use_fetch_output: "{{ zuul_site_use_fetch_output|default(false) }}" +zuul_use_fetch_output: "{{ zuul_site_use_fetch_output | default(false) }}" sphinx_build_dir: doc/build sphinx_pdf_files: - "doc-{{ zuul.project.short_name }}.pdf" diff --git a/roles/fetch-subunit-output/defaults/main.yaml b/roles/fetch-subunit-output/defaults/main.yaml index 59e56317f..a5fc5bcde 100644 --- a/roles/fetch-subunit-output/defaults/main.yaml +++ b/roles/fetch-subunit-output/defaults/main.yaml @@ -2,4 +2,4 @@ fetch_subunit_output_additional_dirs: [] zuul_work_dir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}" zuul_output_dir: "{{ ansible_user_dir }}/zuul-output" -zuul_use_fetch_output: "{{ zuul_site_use_fetch_output|default(false) }}" +zuul_use_fetch_output: "{{ zuul_site_use_fetch_output | default(false) }}" diff --git a/roles/fetch-tox-output/defaults/main.yaml b/roles/fetch-tox-output/defaults/main.yaml index fd4605dc7..a0aa3a346 100644 --- a/roles/fetch-tox-output/defaults/main.yaml +++ b/roles/fetch-tox-output/defaults/main.yaml @@ -4,4 +4,4 @@ tox_executable: tox zuul_work_dir: "{{ zuul.project.src_dir }}" zuul_output_dir: "{{ ansible_user_dir }}/zuul-output" -zuul_use_fetch_output: "{{ zuul_site_use_fetch_output|default(false) }}" +zuul_use_fetch_output: "{{ zuul_site_use_fetch_output | default(false) }}" diff --git a/roles/fetch-translation-output/defaults/main.yaml b/roles/fetch-translation-output/defaults/main.yaml index 0ed152a3b..9f071e8be 100644 --- a/roles/fetch-translation-output/defaults/main.yaml +++ b/roles/fetch-translation-output/defaults/main.yaml @@ -2,4 +2,4 @@ zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts" translation_output_src: "src/{{ zuul.project.canonical_name }}/translation-source/" zuul_output_dir: "{{ ansible_user_dir }}/zuul-output" -zuul_use_fetch_output: "{{ zuul_site_use_fetch_output|default(false) }}" +zuul_use_fetch_output: "{{ zuul_site_use_fetch_output | default(false) }}" diff --git a/roles/find-constraints/tasks/main.yaml b/roles/find-constraints/tasks/main.yaml index 14ddd359b..53b42ea23 100644 --- a/roles/find-constraints/tasks/main.yaml +++ b/roles/find-constraints/tasks/main.yaml @@ -1,6 +1,6 @@ - name: Check to see if the constraints file exists stat: - path: "{{ constraints_file|default('missing') }}" + path: "{{ constraints_file | default('missing') }}" get_checksum: false get_mime: false get_md5: false @@ -14,5 +14,5 @@ - name: Record file location set_fact: - upper_constraints: "-c {{ constraints_file|realpath }}" + upper_constraints: "-c {{ constraints_file | realpath }}" when: not stat_results is skipped and stat_results.stat.exists diff --git a/roles/intercept-job/tasks/wait.yaml b/roles/intercept-job/tasks/wait.yaml index 283f4dfef..91f77917a 100644 --- a/roles/intercept-job/tasks/wait.yaml +++ b/roles/intercept-job/tasks/wait.yaml @@ -5,7 +5,7 @@ - name: Add to current user authorized_key: - key: "{{ intercept_key.content|b64decode }}" + key: "{{ intercept_key.content | b64decode }}" user: "{{ ansible_user }}" - name: Inform user of connection details @@ -23,6 +23,6 @@ - name: Remove key from current user authorized_key: - key: "{{ intercept_key.content|b64decode }}" + key: "{{ intercept_key.content | b64decode }}" user: "{{ ansible_user }}" state: absent diff --git a/roles/markdownlint/tasks/main.yaml b/roles/markdownlint/tasks/main.yaml index 76b50221b..809a5092e 100644 --- a/roles/markdownlint/tasks/main.yaml +++ b/roles/markdownlint/tasks/main.yaml @@ -8,11 +8,11 @@ shell: | set -o pipefail set -e - ~/.markdownlint/node_modules/.bin/markdownlint {{ zj_markdown|relpath(zuul_work_dir) }} 2>&1 | tee -a markdownlint.txt + ~/.markdownlint/node_modules/.bin/markdownlint {{ zj_markdown | relpath(zuul_work_dir) }} 2>&1 | tee -a markdownlint.txt args: chdir: "{{ zuul_work_dir }}" executable: /bin/bash - loop: "{{ markdown_find.files|map(attribute='path')|list }}" + loop: "{{ markdown_find.files | map(attribute='path') | list }}" loop_control: loop_var: zj_markdown changed_when: false diff --git a/roles/phoronix-combine-results/tasks/fetch-result.yaml b/roles/phoronix-combine-results/tasks/fetch-result.yaml index c6b5c55d7..33b1e9648 100644 --- a/roles/phoronix-combine-results/tasks/fetch-result.yaml +++ b/roles/phoronix-combine-results/tasks/fetch-result.yaml @@ -1,11 +1,11 @@ --- - name: Create result dir file: - path: "{{ ansible_env.HOME }}/test-results/{{ zj_artifact.url.rstrip('/')|basename }}" + path: "{{ ansible_env.HOME }}/test-results/{{ zj_artifact.url.rstrip('/') | basename }}" state: directory mode: 0755 - name: Fetch artifact get_url: url: "{{ zj_artifact.url }}/composite.xml" - dest: "{{ ansible_env.HOME }}/test-results/{{ item.url.rstrip('/')|basename }}/composite.xml" + dest: "{{ ansible_env.HOME }}/test-results/{{ item.url.rstrip('/') | basename }}/composite.xml" diff --git a/roles/stage-output/tasks/main.yaml b/roles/stage-output/tasks/main.yaml index 333764841..cf5128874 100644 --- a/roles/stage-output/tasks/main.yaml +++ b/roles/stage-output/tasks/main.yaml @@ -42,7 +42,7 @@ - name: Set source and destination for files and folders set_fact: source: "{{ zj_result.stat.path }}" - dest: "{{ zj_result.zj_source.value.split('_')[0] }}/{{ zj_result.stat.path|basename|regex_replace('^(\\..*)$', '_\\1') }}{% if zj_result.zj_source.value.endswith('_txt') %}.txt{% endif %}" + dest: "{{ zj_result.zj_source.value.split('_')[0] }}/{{ zj_result.stat.path | basename | regex_replace('^(\\..*)$', '_\\1') }}{% if zj_result.zj_source.value.endswith('_txt') %}.txt{% endif %}" type: "{{ zj_result.zj_source.value.split('_')[0] }}" with_items: "{{ sources.results }}" loop_control: diff --git a/roles/tox/tasks/main.yaml b/roles/tox/tasks/main.yaml index 2cf8143ec..0158b0050 100644 --- a/roles/tox/tasks/main.yaml +++ b/roles/tox/tasks/main.yaml @@ -40,7 +40,7 @@ - name: Run tox args: chdir: "{{ zuul_work_dir }}" - environment: "{{ tox_environment|combine(tox_constraints_env|default({})) }}" + environment: "{{ tox_environment | combine(tox_constraints_env | default({})) }}" command: >- {{ tox_executable }} {% if tox_config_file is defined and tox_config_file %} diff --git a/roles/tox/tasks/siblings.yaml b/roles/tox/tasks/siblings.yaml index 33ba98828..a25563420 100644 --- a/roles/tox/tasks/siblings.yaml +++ b/roles/tox/tasks/siblings.yaml @@ -12,7 +12,7 @@ {{ tox_extra_args }} args: chdir: "{{ zuul_work_dir }}" - environment: "{{ tox_environment|combine(tox_constraints_env|default({})) }}" + environment: "{{ tox_environment | combine(tox_constraints_env | default({})) }}" # This is needed since python < 3.2 can't parse ini files from strings - name: Create a tempfile to save tox showconfig @@ -33,7 +33,7 @@ > {{ _tox_show_config_tempfile.path }} args: chdir: "{{ zuul_work_dir }}" - environment: "{{ tox_environment|combine(tox_constraints_env|default({})) }}" + environment: "{{ tox_environment | combine(tox_constraints_env | default({})) }}" - name: Install any sibling python packages tox_install_sibling_packages: diff --git a/roles/upload-artifactory/tasks/upload.yaml b/roles/upload-artifactory/tasks/upload.yaml index e87bc43c3..ed8ce5269 100644 --- a/roles/upload-artifactory/tasks/upload.yaml +++ b/roles/upload-artifactory/tasks/upload.yaml @@ -27,7 +27,7 @@ - name: Add artifact headers set_fact: - request_header: "{{ request_header | combine(zj_artifact.headers|default({})) }}" + request_header: "{{ request_header | combine(zj_artifact.headers | default({})) }}" - name: Add api key to header when: "'api_key' in upload_artifactory_instances[zj_artifact.instance]" @@ -70,7 +70,7 @@ - name: Set upload url set_fact: _artifactory_upload_url: "\ - {%- if zj_artifact_properties|length -%} + {%- if zj_artifact_properties | length -%} {{ _artifactory_backend_url }};{{ zj_artifact_properties | default('') }}\ {%- else -%} {{ _artifactory_backend_url }}\ diff --git a/roles/upload-npm/defaults/main.yaml b/roles/upload-npm/defaults/main.yaml index f94df3885..07b3540ba 100644 --- a/roles/upload-npm/defaults/main.yaml +++ b/roles/upload-npm/defaults/main.yaml @@ -1 +1 @@ -npm_registry_url: "{{ npm_credentials.registry_url|default('//registry.npmjs.org') }}" +npm_registry_url: "{{ npm_credentials.registry_url | default('//registry.npmjs.org') }}" diff --git a/roles/upload-pypi/defaults/main.yaml b/roles/upload-pypi/defaults/main.yaml index 1d4b7501f..32c2c523e 100644 --- a/roles/upload-pypi/defaults/main.yaml +++ b/roles/upload-pypi/defaults/main.yaml @@ -1,6 +1,6 @@ --- pypi_path: "src/{{ zuul.project.canonical_name }}/dist" -pypi_repository: "{{ pypi_info.repository|default('pypi') }}" -pypi_repository_url: "{{ pypi_info.repository_url|default(None) }}" +pypi_repository: "{{ pypi_info.repository | default('pypi') }}" +pypi_repository_url: "{{ pypi_info.repository_url | default(None) }}" pypi_twine_executable: twine pypi_register_first: false diff --git a/roles/validate-host/tasks/main.yaml b/roles/validate-host/tasks/main.yaml index 78b288bac..b56308264 100644 --- a/roles/validate-host/tasks/main.yaml +++ b/roles/validate-host/tasks/main.yaml @@ -29,11 +29,11 @@ block: - name: Collect information about zuul worker zuul_debug_info: - ipv4_route_required: "{{ zuul_site_ipv4_route_required|default(false) }}" - ipv6_route_required: "{{ zuul_site_ipv6_route_required|default(false) }}" - image_manifest: "{{ zuul_site_image_manifest|default(omit) }}" - image_manifest_files: "{{ zuul_site_image_manifest_files|default(omit) }}" - traceroute_host: "{{ zuul_site_traceroute_host|default(omit) }}" + ipv4_route_required: "{{ zuul_site_ipv4_route_required | default(false) }}" + ipv6_route_required: "{{ zuul_site_ipv6_route_required | default(false) }}" + image_manifest: "{{ zuul_site_image_manifest | default(omit) }}" + image_manifest_files: "{{ zuul_site_image_manifest_files | default(omit) }}" + traceroute_host: "{{ zuul_site_traceroute_host | default(omit) }}" register: zdi - name: Write out all zuul information for each host