summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGonéri Le Bouder <goneri@lebouder.net>2021-03-07 23:38:05 -0500
committerGitHub <noreply@github.com>2021-03-07 22:38:05 -0600
commit462edf003ef6954a9b5dc58cbb793e3d7bab2116 (patch)
tree01c095c5c5ea7697abacd16be2a0d3fdb278a0d2 /test
parent8493662b8951e8c11ebd9aeff6e2f896184d0781 (diff)
downloadansible-462edf003ef6954a9b5dc58cbb793e3d7bab2116.tar.gz
ansible-test: yamllint, check the assigment (#73584)
Ensure `yamllint`'s `check_assignment()` correctly ignore the attribute assignment. Those don't have any `.id` attribute and will trigger an `AttributeError` exception. See: https://github.com/ansible/ansible/pull/73322 (cherry picked from commit 0a8d5c098367a58eaff10fd5b3868f099c1e17a7)
Diffstat (limited to 'test')
-rwxr-xr-xtest/lib/ansible_test/_data/sanity/yamllint/yamllinter.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/lib/ansible_test/_data/sanity/yamllint/yamllinter.py b/test/lib/ansible_test/_data/sanity/yamllint/yamllinter.py
index efde78a6d0..01e59011c4 100755
--- a/test/lib/ansible_test/_data/sanity/yamllint/yamllinter.py
+++ b/test/lib/ansible_test/_data/sanity/yamllint/yamllinter.py
@@ -128,7 +128,7 @@ class YamlChecker:
def check_assignment(statement, doc_types=None):
"""Check the given statement for a documentation assignment."""
for target in statement.targets:
- if isinstance(target, ast.Tuple):
+ if not isinstance(target, ast.Name):
continue
if doc_types and target.id not in doc_types: