ansible/changelogs
Gonéri Le Bouder 985a395cd9 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

(cherry picked from commit 7cf80f50d1)
2021-02-03 09:07:14 -08:00
..
fragments validate_modules: fails with .id attribute not found (#73322) 2021-02-03 09:07:14 -08:00
CHANGELOG-v2.10.rst New release v2.10.5 2021-01-18 14:34:40 -06:00
CHANGELOG.rst
changelog.yaml New release v2.10.5 2021-01-18 14:34:40 -06:00
config.yaml Make changelog tool be more strict about suffixes (#70909) (#71135) 2020-08-21 09:33:08 -07:00