hcloud_networ_info: be more resilient is network already exists

We may already have an existing network or subnet. This commit ensures
we don't raise an error in this case.
e.g: https://app.shippable.com/github/ansible/ansible/runs/143559/145/tests

(cherry picked from commit 459677877a)
This commit is contained in:
Gonéri Le Bouder 2019-09-17 14:59:25 -04:00 committed by Toshio Kuratomi
parent 51b8daa64d
commit 997f272c4e

View file

@ -52,9 +52,9 @@
- name: verify test gather hcloud network info in check mode
assert:
that:
- hcloud_network.hcloud_network_info | selectattr('name','equalto','{{ hcloud_network_name }}') | list | count == 1
- hcloud_network.hcloud_network_info[0].subnetworks | list | count == 1
- hcloud_network.hcloud_network_info[0].routes | list | count == 1
- hcloud_network.hcloud_network_info | selectattr('name','equalto','{{ hcloud_network_name }}') | list | count >= 1
- hcloud_network.hcloud_network_info[0].subnetworks | list | count >= 1
- hcloud_network.hcloud_network_info[0].routes | list | count >= 1
- name: test gather hcloud network info with correct label selector
hcloud_network_info: