diff --git a/ci/roles/nova_services/tasks/main.yml b/ci/roles/nova_services/tasks/main.yml index 37c3459d..60e244d2 100644 --- a/ci/roles/nova_services/tasks/main.yml +++ b/ci/roles/nova_services/tasks/main.yml @@ -6,7 +6,16 @@ register: result 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: that: - '["availability_zone", "binary", "disabled_reason", "is_forced_down", diff --git a/plugins/modules/compute_service_info.py b/plugins/modules/compute_service_info.py index 427843b3..03ebf534 100644 --- a/plugins/modules/compute_service_info.py +++ b/plugins/modules/compute_service_info.py @@ -61,7 +61,11 @@ openstack_compute_services: type: str disabled_reason: 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 availability_zone: description: The availability zone name.