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
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
..
cli Prepare ansible-test for inclusion in setup.py (#60294) 6 years ago
completion [centos6] update container for EOL (#72797) 5 years ago
injector Support venv in ansible-test virtualenv scripts (#73164) 5 years ago
playbooks PowerShell - Added coverage collector (#59009) 6 years ago
pytest/plugins [stable-2.9] fix collection package root location under pytest >=6.0.0 (#70963). 5 years ago
requirements Fix cryptography install in ansible-test. 5 years ago
sanity [stable-2.9] validate_modules: fails with .id attribute not found (#73322) (#74179) 5 years ago
setup [stable-2.9] Use a versioned pip bootstrapper in ansible-test. (#73360) 5 years ago
ansible.cfg Update ansible-test integration config handling. (#60448) 6 years ago
coveragerc Move ansible-test coverage config to test/lib/ 6 years ago
inventory Update ansible-test collection inventory handling. (#61031) 6 years ago
pytest.ini Relocate ansible-test code. (#60147) 7 years ago
tox.ini Relocate ansible-test code. (#60147) 7 years ago
versions.py [stable-2.9] Ignore warnings in ansible-test environment check. 6 years ago
virtualenvcheck.py [stable-2.9] Work around virtualenv/venv issue in ansible-test. (#62111) 6 years ago
yamlcheck.py Relocate ansible-test code. (#60147) 7 years ago