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 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
4 years ago
..
ansible_test Relocate ansible-test self tests outside package. (#61255) 5 years ago
integration lineinfile - add search_string parameter for non-regexp searching (#70647) 4 years ago
lib/ansible_test validate_modules: fails with .id attribute not found (#73322) 4 years ago
sanity Limit rstcheck sanity test to ansible-core. (#73391) 4 years ago
support Various intentional tests (#72485) 4 years ago
units Correct pkg_mgr for Fedora-derived OSTree distros (#73445) 4 years ago
utils/shippable [devel] Azure Pipelines configuration. 4 years ago