mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-07-28 10:44:29 +00:00
Fixed return value disable{d,s}_reason in compute_service_info module
OpenStack SDK 0.53 renamed parameter disables_reason to disabled_reason
in openstack/compute/v2/service.py, hence our compute_service_info
module will return different values depending on which release of
the OpenStack SDK is used.
Ref.: 5450c45253
Change-Id: I1c0f787f7f67c92f92dd106fc8d55580461e4aa3
This commit is contained in:
@@ -6,7 +6,16 @@
|
|||||||
register: result
|
register: result
|
||||||
failed_when: "result.openstack_compute_services | length <= 0"
|
failed_when: "result.openstack_compute_services | length <= 0"
|
||||||
|
|
||||||
- name: Assert fields
|
- name: Assert fields on OpenStack SDK before 0.53
|
||||||
|
when: sdk_version is version(0.53, '<')
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- '["availability_zone", "binary", "disables_reason", "is_forced_down",
|
||||||
|
"host", "name", "state", "status", "updated_at", "id"] |
|
||||||
|
difference(result.openstack_compute_services.0.keys()) | length == 0'
|
||||||
|
|
||||||
|
- name: Assert fields on OpenStack SDK 0.53 and later
|
||||||
|
when: sdk_version is version(0.53, '>=')
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- '["availability_zone", "binary", "disabled_reason", "is_forced_down",
|
- '["availability_zone", "binary", "disabled_reason", "is_forced_down",
|
||||||
|
|||||||
@@ -61,7 +61,11 @@ openstack_compute_services:
|
|||||||
type: str
|
type: str
|
||||||
disabled_reason:
|
disabled_reason:
|
||||||
description: The reason why the service is disabled
|
description: The reason why the service is disabled
|
||||||
returned: success
|
returned: success and OpenStack SDK >= 0.53
|
||||||
|
type: str
|
||||||
|
disables_reason:
|
||||||
|
description: The reason why the service is disabled
|
||||||
|
returned: success and OpenStack SDK < 0.53
|
||||||
type: str
|
type: str
|
||||||
availability_zone:
|
availability_zone:
|
||||||
description: The availability zone name.
|
description: The availability zone name.
|
||||||
|
|||||||
Reference in New Issue
Block a user