Check return value for router create

The newest openstacksdk is set to rename some of the field names of
return values. This also affects the openstack.cloud collection. This
patch checks for both field names to make sure the os_tempest role
doesn't break when the collections release.

Change-Id: I4b30650a6c78e76982e22746933be7c132490a43
This commit is contained in:
Rafael Castillo 2022-06-20 14:00:18 -07:00
parent 18f2c885da
commit 56c07080a7
1 changed files with 10 additions and 0 deletions

View File

@ -277,12 +277,22 @@
- tempest_router_create | bool
- name: Get router admin state and ip address
set_fact:
router_admin_state: "{{ _add_router['router']['is_admin_state_up'] }}"
router_ip: "{{ _add_router['router']['external_gateway_info']['external_fixed_ips'][0]['ip_address'] }}"
when:
- tempest_service_available_neutron | bool
- tempest_router_create | bool
- "'is_admin_state_up' in _add_router.router"
- name: Get router admin state and ip address for older collection versions
set_fact:
router_admin_state: "{{ _add_router['router']['admin_state_up'] }}"
router_ip: "{{ _add_router['router']['external_gateway_info']['external_fixed_ips'][0]['ip_address'] }}"
when:
- tempest_service_available_neutron | bool
- tempest_router_create | bool
- "'admin_state_up' in _add_router.router"
- name: Create tempest flavors
openstack.cloud.compute_flavor: