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
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
..
ansible_test Relocate ansible-test self tests outside package. (#61255) 7 years ago
integration [stable-2.9] find - set proper default based on use_regex (#73961) (#73966) 5 years ago
legacy Rename Azure modules: facts -> info (#61505) 7 years ago
lib/ansible_test [stable-2.9] validate_modules: fails with .id attribute not found (#73322) (#74179) 5 years ago
sanity [security] Add more missing no_logs (#74115) 5 years ago
units [stable-2.9] Add AlmaLinux to the family of Red Hat-like operating systems (#73541) (#73544) 5 years ago
utils [stable-2.9] Azure Pipelines configuration. 5 years ago