ansible/test
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
..
ansible_test
integration lineinfile - add search_string parameter for non-regexp searching (#70647) 2021-02-02 15:37:06 -05:00
lib/ansible_test validate_modules: fails with .id attribute not found (#73322) 2021-02-02 13:29:36 -08:00
sanity Limit rstcheck sanity test to ansible-core. (#73391) 2021-01-27 21:06:00 -08:00
support Various intentional tests (#72485) 2020-11-06 08:41:41 -06:00
units Correct pkg_mgr for Fedora-derived OSTree distros (#73445) 2021-02-02 15:09:30 -05:00
utils/shippable [devel] Azure Pipelines configuration. 2020-12-02 13:40:01 -08:00