1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

fix: consistently fail on invalid ID in *_info modules (#301)

* fix: consistently fail on invalid ID in `*_info` modules

* remove unused import
This commit is contained in:
Jonas L 2023-08-16 16:14:55 +02:00 committed by GitHub
parent 0506fd76d1
commit e461a890fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 29 additions and 16 deletions

View file

@ -49,7 +49,8 @@
hetzner.hcloud.hcloud_location_info:
id: 4711
register: result
ignore_errors: true
- name: Verify hcloud_location_info with wrong id
ansible.builtin.assert:
that:
- result.hcloud_location_info | list | count == 0
- result is failed

View file

@ -103,12 +103,13 @@
- name: test gather hcloud network info with wrong id
hetzner.hcloud.hcloud_network_info:
name: "4711"
id: "4711"
register: hcloud_network
ignore_errors: true
- name: verify test gather hcloud network with wrong id
assert:
that:
- hcloud_network.hcloud_network_info | list | count == 0
- hcloud_network is failed
- name: cleanup
hetzner.hcloud.hcloud_network:

View file

@ -82,12 +82,13 @@
- name: test gather hcloud server infos with wrong id
hetzner.hcloud.hcloud_server_info:
name: "4711"
id: "4711"
register: server
ignore_errors: true
- name: verify test gather hcloud server infos with wrong id
assert:
that:
- server.hcloud_server_info | list | count == 0
- server is failed
- name: cleanup
hetzner.hcloud.hcloud_server:

View file

@ -83,12 +83,13 @@
- name: test gather hcloud volume infos with wrong id
hetzner.hcloud.hcloud_volume_info:
name: "4711"
id: "4711"
register: hcloud_volume
ignore_errors: true
- name: verify test gather hcloud volume infos with wrong id
assert:
that:
- hcloud_volume.hcloud_volume_info | list | count == 0
- hcloud_volume is failed
- name: cleanup
hetzner.hcloud.hcloud_volume: