From 7a28246248cdb7fdbfde281488d813c953aa8e75 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 12 Oct 2021 17:29:27 +0200 Subject: [PATCH] validate_modules: allow 'choices' for return values (#76009) * Allow 'choices' for return values. --- .../fragments/76009-validate-modules-choices-return-value.yml | 2 ++ .../sanity/validate-modules/validate_modules/schema.py | 1 + 2 files changed, 3 insertions(+) create mode 100644 changelogs/fragments/76009-validate-modules-choices-return-value.yml diff --git a/changelogs/fragments/76009-validate-modules-choices-return-value.yml b/changelogs/fragments/76009-validate-modules-choices-return-value.yml new file mode 100644 index 00000000000..561c8490250 --- /dev/null +++ b/changelogs/fragments/76009-validate-modules-choices-return-value.yml @@ -0,0 +1,2 @@ +minor_changes: + - "ansible-test validate_modules - allow ``choices`` for return values (https://github.com/ansible/ansible/pull/76009)." diff --git a/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py b/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py index ed098cbc9ca..f81f369c588 100644 --- a/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py +++ b/test/lib/ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py @@ -395,6 +395,7 @@ def return_schema(for_collection): Required('type'): Any('bool', 'complex', 'dict', 'float', 'int', 'list', 'str'), 'version_added': version(for_collection), 'version_added_collection': collection_name, + 'choices': Any([object], (object,)), 'sample': json_value, 'example': json_value, 'contains': Any(None, *list({str_type: Self} for str_type in string_types)),