You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/lib/ansible_test/_data/sanity
Gonéri Le Bouder f4ec55b2d8
[stable-2.9] validate_modules: fails with .id attribute not found (#73322) (#74179)
* validate_modules: fails with .id attribute not found

This patch addresses a problem in the `found_try_except_import` test.

This module tries to identify lines like:

`HAS_FOO = True`

In this case, the target (`HAS_FOO`) is of type `ast.Name` and has a
`id` attribute which provide the name.

In my case, I've a line that set a module attribute`. In this case, the
target (`module.var`) has the type `ast.Attribute` and no `id`
attribute. The code trigger an `AttributeError` exception.

This patch ensures we compare a `ast.Name`.

* Update test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/main.py

(cherry picked from commit 7cf80f50d1)
5 years ago
..
code-smell Fix shebang sanity test module identification. (#69404) 6 years ago
compile Relocate ansible-test code. (#60147) 7 years ago
import [stable-2.9] Set alter_sys=True instead of False to address backwards… (#64686) 6 years ago
integration-aliases [stable-2.9] Use AZP config for integration-aliases test. 5 years ago
pep8 Relocate ansible-test code. (#60147) 7 years ago
pslint Relocate ansible-test code. (#60147) 7 years ago
pylint [stable-2.9] Update ansible-test pylint Python support. (#72972) (#73355) 5 years ago
rstcheck Autointerpreter table (#60148) 7 years ago
shellcheck Fix sanity tests based on newer version of shellcheck (#60423) 6 years ago
validate-modules [stable-2.9] validate_modules: fails with .id attribute not found (#73322) (#74179) 5 years ago
yamllint ansible-test: yamllint, check the assigment (#73584) 5 years ago