Fix linting errors.

This commit is contained in:
Felix Fontein
2025-04-26 11:20:32 +02:00
parent 795e6b23dc
commit 2487d1a0bf
125 changed files with 5778 additions and 5662 deletions
@@ -9,70 +9,70 @@
####################################################################
- block:
- name: Create random network name
set_fact:
nname: "{{ 'ansible-docker-test-%0x' % ((2**32) | random) }}"
- name: Create random network name
set_fact:
nname: "{{ 'ansible-docker-test-%0x' % ((2**32) | random) }}"
- name: Make sure network is not there
docker_network:
name: "{{ nname }}"
state: absent
force: true
- name: Make sure network is not there
docker_network:
name: "{{ nname }}"
state: absent
force: true
- name: Inspect a non-present network
docker_network_info:
name: "{{ nname }}"
register: result
- name: Inspect a non-present network
docker_network_info:
name: "{{ nname }}"
register: result
- assert:
that:
- "not result.exists"
- "'network' in result"
- "result.network is none"
- assert:
that:
- "not result.exists"
- "'network' in result"
- "result.network is none"
- name: Make sure network exists
docker_network:
name: "{{ nname }}"
state: present
- name: Make sure network exists
docker_network:
name: "{{ nname }}"
state: present
- name: Inspect a present network
docker_network_info:
name: "{{ nname }}"
register: result
- name: Dump docker_network_info result
debug: var=result
- name: Inspect a present network
docker_network_info:
name: "{{ nname }}"
register: result
- name: Dump docker_network_info result
debug: var=result
- name: "Comparison: use 'docker network inspect'"
command: docker network inspect "{{ nname }}"
register: docker_inspect
ignore_errors: true
- block:
- set_fact:
docker_inspect_result: "{{ docker_inspect.stdout | from_json }}"
- name: Dump docker inspect result
debug: var=docker_inspect_result
when: docker_inspect is not failed
- name: "Comparison: use 'docker network inspect'"
command: docker network inspect "{{ nname }}"
register: docker_inspect
ignore_errors: true
- block:
- set_fact:
docker_inspect_result: "{{ docker_inspect.stdout | from_json }}"
- name: Dump docker inspect result
debug: var=docker_inspect_result
when: docker_inspect is not failed
- name: Cleanup
docker_network:
name: "{{ nname }}"
state: absent
force: true
- name: Cleanup
docker_network:
name: "{{ nname }}"
state: absent
force: true
- assert:
that:
- result.exists
- "'network' in result"
- "result.network is truthy"
- assert:
that:
- result.exists
- "'network' in result"
- "result.network is truthy"
- assert:
that:
- "result.network == docker_inspect_result[0]"
when: docker_inspect is not failed
- assert:
that:
- "'is too new. Maximum supported API version is' in docker_inspect.stderr"
when: docker_inspect is failed
- assert:
that:
- "result.network == docker_inspect_result[0]"
when: docker_inspect is not failed
- assert:
that:
- "'is too new. Maximum supported API version is' in docker_inspect.stderr"
when: docker_inspect is failed
when: docker_api_version is version('1.25', '>=')