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:
parent
0506fd76d1
commit
e461a890fa
20 changed files with 29 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue