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/units/plugins/lookup
Gaudenz Steinlin c33a782a9c
Fix password lookup rewrites file when using encrypt (#79431)
* Remove unused mock from test_password_already_created_encrypt

The _get_paths mock is never used in the
test_password_already_created_encrypt test case.

* Add test to assert the password file is not rewritten

If the password file already contains the salt and the hasing algorithm
does not use the ident parameter, the password lookup should not write
to the password file.

* Fix "changed" if using "encrypt" in password lookup

When using the "encrypt" parameter to the password lookup without the
ident parameter, the password file was always marked as "changed". This
caused the file to be rewritten with the same content. This is fixed by
only marking the file as changed, if an "ident" value needs to be added
to the file.

Fixes #79430.

Add changelog entry
2 years ago
..
__init__.py Add empty-init code-smell script. (#18406) 8 years ago
test_env.py Fix env lookup plugin error on utf8 values (#65541) 5 years ago
test_ini.py All lookups ported to config system (#74108) 3 years ago
test_password.py Fix password lookup rewrites file when using encrypt (#79431) 2 years ago
test_url.py url lookup - set default user agent (#72324) 4 years ago