1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-21 11:19:00 +00:00
community.general/plugins/module_utils
patchback[bot] dc79f4a170
[PR #11860/25b21183 backport][stable-12] udm_user, homectl - replace crypt/legacycrypt with passlib (#11884)
udm_user, homectl - replace crypt/legacycrypt with passlib (#11860)

* udm_user - replace crypt/legacycrypt with passlib

The stdlib crypt module was removed in Python 3.13. Replace the
crypt/legacycrypt import chain with passlib (already used elsewhere
in the collection) and use CryptContext.verify() for password
comparison.

Fixes #4690



* Add changelog fragment for PR 11860



* remove redundant ignore file entries

* udm_user, homectl - replace crypt/legacycrypt with _crypt module utils

Add a new _crypt module_utils that abstracts password hashing and
verification. It uses passlib when available, falling back to the
stdlib crypt or legacycrypt, and raises ImportError if none of them
can be imported. Both udm_user and homectl now use this shared
utility, fixing compatibility with Python 3.13+.

Fixes #4690



* Add BOTMETA entry for _crypt module utils



* _crypt - fix mypy errors and handle complete unavailability

Replace CryptContext = object fallback (rejected by mypy) with a
proper dummy class definition. Add has_crypt_context flag so modules
can detect when no backend is available. Update both modules to
import and check has_crypt_context instead of testing for None.



* adjsutments from review

* Update plugins/modules/homectl.py



* Update plugins/modules/udm_user.py



---------



(cherry picked from commit 25b21183bb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-19 22:51:20 +02:00
..
identity/keycloak [PR #11585/25b5655b backport][stable-12] keycloak_authentication_v2: verify providerIds (fix 11583) (#11619) 2026-03-18 18:14:37 +01:00
mh [PR #11488/5e0fd120 backport][stable-12] ModuleHelper: ensure compatibility with ModuleTestCase (#11518) 2026-02-18 07:26:47 +01:00
net_tools/pritunl [PR #11561/7436c0c9 backport][stable-12] replace literal HTTP codes with http.HTTPStatus (#11568) 2026-03-10 22:14:27 +01:00
oracle [PR #11561/7436c0c9 backport][stable-12] replace literal HTTP codes with http.HTTPStatus (#11568) 2026-03-10 22:14:27 +01:00
remote_management/lxca [PR #11283/ef632145 backport][stable-12] Add more module_utils typing (#11289) 2025-12-17 21:24:55 +01:00
source_control [PR #11561/7436c0c9 backport][stable-12] replace literal HTTP codes with http.HTTPStatus (#11568) 2026-03-10 22:14:27 +01:00
storage [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
__init__.py Add __init__.py to work around ansible-test/pylint bug (#10926) 2025-10-15 21:42:55 +02:00
_crypt.py [PR #11860/25b21183 backport][stable-12] udm_user, homectl - replace crypt/legacycrypt with passlib (#11884) 2026-04-19 22:51:20 +02:00
_filelock.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
_icinga2.py [PR #11462/ce7cb4e9 backport][stable-12] New module icinga2_downtime (#11532) 2026-02-23 06:17:51 +01:00
_lvm.py [PR #11835/3416efa5 backport][stable-12] lvg - migrate to CmdRunner (#11858) 2026-04-17 18:33:10 +02:00
_lxc.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
_stormssh.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
alicloud_ecs.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
android_sdkmanager.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
btrfs.py [PR #11787/95e2b771 backport][stable-12] Ensure standard locale in run_command (group5-batch16) (#11798) 2026-04-12 22:27:35 +02:00
cloud.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
cmd_runner.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
cmd_runner_fmt.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
consul.py [PR #11573/f9e583da backport][stable-12] fix: remove HTTPStatus constructs introduced in Python 3.11 (#11575) 2026-03-12 20:59:26 +01:00
csv.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
database.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
datetime.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
deps.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
dimensiondata.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
django.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
gandi_livedns_api.py [PR #11561/7436c0c9 backport][stable-12] replace literal HTTP codes with http.HTTPStatus (#11568) 2026-03-10 22:14:27 +01:00
gconftool2.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
gio_mime.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
gitlab.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
heroku.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
homebrew.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
hwc_utils.py [PR #11573/f9e583da backport][stable-12] fix: remove HTTPStatus constructs introduced in Python 3.11 (#11575) 2026-03-12 20:59:26 +01:00
ibm_sa_utils.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
ilo_redfish_utils.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
influxdb.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
ipa.py [PR #11698/47ef322a backport][stable-12] ipa module utils: detect and fail on errors in API response failed field (#11710) 2026-03-30 21:43:39 +02:00
jenkins.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
known_hosts.py [PR #11768/b40608a3 backport][stable-12] Ensure standard locale in run_command (group5-batch1) (#11795) 2026-04-12 22:29:14 +02:00
ldap.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
linode.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
locale_gen.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
lxd.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
manageiq.py [PR #11879/77509be2 backport][stable-12] Replace .format() calls with f-strings across multiple plugins (#11881) 2026-04-19 12:49:29 +02:00
memset.py [PR #11561/7436c0c9 backport][stable-12] replace literal HTTP codes with http.HTTPStatus (#11568) 2026-03-10 22:14:27 +01:00
module_helper.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
ocapi_utils.py [PR #11561/7436c0c9 backport][stable-12] replace literal HTTP codes with http.HTTPStatus (#11568) 2026-03-10 22:14:27 +01:00
oneandone.py [PR #11043/3478863e backport][stable-12] Address issues reported by ruff check (#11047) 2025-11-08 09:49:52 +01:00
onepassword.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
oneview.py [PR #11879/77509be2 backport][stable-12] Replace .format() calls with f-strings across multiple plugins (#11881) 2026-04-19 12:49:29 +02:00
online.py [PR #11561/7436c0c9 backport][stable-12] replace literal HTTP codes with http.HTTPStatus (#11568) 2026-03-10 22:14:27 +01:00
opennebula.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
pacemaker.py [PR #11750/6c809dd9 backport][stable-12] pacemaker: fix race condition on resource creation (#11877) 2026-04-18 22:55:56 +02:00
pipx.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
pkg_req.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
puppet.py [PR #11658/25a4f568 backport][stable-12] puppet: deprecate param timeout (#11665) 2026-03-23 20:35:09 +01:00
python_runner.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
redfish_utils.py [PR #11573/f9e583da backport][stable-12] fix: remove HTTPStatus constructs introduced in Python 3.11 (#11575) 2026-03-12 20:59:26 +01:00
redis.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
rundeck.py [PR #11573/f9e583da backport][stable-12] fix: remove HTTPStatus constructs introduced in Python 3.11 (#11575) 2026-03-12 20:59:26 +01:00
saslprep.py [PR #11205/d364e354 backport][stable-12] Deprecate unused module utils (#11213) 2025-11-25 21:41:56 +01:00
scaleway.py [PR #11561/7436c0c9 backport][stable-12] replace literal HTTP codes with http.HTTPStatus (#11568) 2026-03-10 22:14:27 +01:00
snap.py [PR #11682/b79a4575 backport][stable-12] snap_connect: new module to manage snap interface connections (#11722) 2026-04-03 07:35:13 +02:00
ssh.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
systemd.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
univention_umc.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
utm_utils.py [PR #11573/f9e583da backport][stable-12] fix: remove HTTPStatus constructs introduced in Python 3.11 (#11575) 2026-03-12 20:59:26 +01:00
vardict.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
version.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
vexata.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
wdc_redfish_utils.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
xdg_mime.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
xenserver.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
xfconf.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00