ansible/test/lib/ansible_test/_data/sanity
Gonéri Le Bouder 7cf80f50d1
validate_modules: fails with .id attribute not found (#73322)
* 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
2021-02-02 13:29:36 -08:00
..
code-smell Avoid sphinx usage in changelog sanity test. 2021-01-27 23:52:13 -08:00
compile Add Python 3.9 to ansible-test. 2020-03-01 17:42:06 -08:00
import Code cleanup in the import sanity test. 2020-06-23 23:09:00 -07:00
integration-aliases Use AZP config for integration-aliases test. 2020-12-03 15:35:58 -08:00
pep8
pslint
pylint import_playbook - change additional params to deprecation (#72987) 2020-12-17 14:14:58 -05:00
shellcheck Fix sanity tests based on newer version of shellcheck (#60423) 2019-08-12 16:24:28 -04:00
validate-modules validate_modules: fails with .id attribute not found (#73322) 2021-02-02 13:29:36 -08:00
yamllint Clean up code in ansible-test. (#73379) 2021-01-26 14:02:08 -08:00