From 4b7f4ba9544a598f480a1febddeb49a2da804b80 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Wed, 8 Jul 2020 16:17:12 -0400 Subject: [PATCH] Fix ansible-test error in community.aws (#70507) * 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) --- 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 00000000000000..b93d0f397a41fb --- /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 22b1a53d111774..5ca248124cf1d5 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):