From 155041d8ee50c7abdb18cd5e8fc4229a9463524a Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 29 Jul 2020 22:51:47 +0200 Subject: [PATCH] Fix ansible-test error in community.aws (#70507) (#70873) * Fix ansible-test error in community.aws * Add changelog entry for fix * Change check from None to string_types * Update changelogs/fragments/70507-validate-null-author.yaml clarify wording "or a list of strings" Co-authored-by: Felix Fontein * Update test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/schema.py clarify wording - single string or not specified valid Co-authored-by: Felix Fontein * Do not fail but return None when given outside list Co-authored-by: Felix Fontein (cherry picked from commit b0d9deeae3fbcd79ba1dfb3635ba88dba79712d6) Co-authored-by: Alan Rominger --- changelogs/fragments/70507-validate-null-author.yaml | 2 ++ .../sanity/validate-modules/validate_modules/schema.py | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 changelogs/fragments/70507-validate-null-author.yaml diff --git a/changelogs/fragments/70507-validate-null-author.yaml b/changelogs/fragments/70507-validate-null-author.yaml new file mode 100644 index 00000000000..b93d0f397a4 --- /dev/null +++ b/changelogs/fragments/70507-validate-null-author.yaml @@ -0,0 +1,2 @@ +bugfixes: + - Fixes ansible-test traceback when plugin author is not a string or a list of strings (https://github.com/ansible/ansible/pull/70507) diff --git a/test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/schema.py b/test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/schema.py index 22b1a53d111..5ca248124cf 100644 --- a/test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/schema.py +++ b/test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/schema.py @@ -412,15 +412,21 @@ def deprecation_schema(for_collection): def author(value): + if value is None: + return value # let schema checks handle if not is_iterable(value): value = [value] for line in value: + if not isinstance(line, string_types): + continue # let schema checks handle m = author_line.search(line) if not m: raise Invalid("Invalid author") + return value + def doc_schema(module_name, for_collection=False, deprecated_module=False):