1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-21 19:29:05 +00:00
community.general/plugins/module_utils
Alexei Znamensky 25b21183bb
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

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add changelog fragment for PR 11860

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* 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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Add BOTMETA entry for _crypt module utils

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* _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.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* adjsutments from review

* Update plugins/modules/homectl.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/udm_user.py

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-04-20 07:53:44 +12:00
..
identity/keycloak keycloak_authentication_v2: verify providerIds (fix 11583) (#11585) 2026-03-18 07:06:09 +01:00
mh ModuleHelper: ensure compatibility with ModuleTestCase (#11488) 2026-02-18 07:08:49 +01:00
net_tools/pritunl replace literal HTTP codes with http.HTTPStatus (#11561) 2026-03-10 22:03:55 +01:00
oracle replace literal HTTP codes with http.HTTPStatus (#11561) 2026-03-10 22:03:55 +01:00
remote_management/lxca Add more module_utils typing (#11283) 2025-12-15 19:46:51 +01:00
source_control replace literal HTTP codes with http.HTTPStatus (#11561) 2026-03-10 22:03:55 +01:00
storage Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +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 udm_user, homectl - replace crypt/legacycrypt with passlib (#11860) 2026-04-20 07:53:44 +12:00
_filelock.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
_icinga2.py New module icinga2_downtime (#11462) 2026-02-23 05:38:54 +01:00
_lvm.py lvg - migrate to CmdRunner (#11835) 2026-04-17 08:54:11 +02:00
_lxc.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
_stormssh.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
alicloud_ecs.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
android_sdkmanager.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
btrfs.py Ensure standard locale in run_command (group5-batch16) (#11787) 2026-04-13 07:56:51 +12:00
cloud.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
cmd_runner.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
cmd_runner_fmt.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
consul.py fix: remove HTTPStatus constructs introduced in Python 3.11 (#11573) 2026-03-12 20:46:55 +01:00
csv.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
database.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
datetime.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
deps.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
dimensiondata.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
django.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
gandi_livedns_api.py replace literal HTTP codes with http.HTTPStatus (#11561) 2026-03-10 22:03:55 +01:00
gconftool2.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
gio_mime.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
gitlab.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
heroku.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
homebrew.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
hwc_utils.py fix: remove HTTPStatus constructs introduced in Python 3.11 (#11573) 2026-03-12 20:46:55 +01:00
ibm_sa_utils.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
ilo_redfish_utils.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
influxdb.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
ipa.py ipa module utils: detect and fail on errors in API response failed field (#11698) 2026-03-31 07:41:10 +13:00
jenkins.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
known_hosts.py Ensure standard locale in run_command (group5-batch1) (#11768) 2026-04-13 07:50:25 +12:00
ldap.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
linode.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
locale_gen.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
lxd.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
manageiq.py Replace .format() calls with f-strings across multiple plugins (#11879) 2026-04-19 22:37:32 +12:00
memset.py replace literal HTTP codes with http.HTTPStatus (#11561) 2026-03-10 22:03:55 +01:00
module_helper.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
ocapi_utils.py replace literal HTTP codes with http.HTTPStatus (#11561) 2026-03-10 22:03:55 +01:00
oneandone.py Address issues reported by ruff check (#11043) 2025-11-08 17:05:21 +13:00
onepassword.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
oneview.py Replace .format() calls with f-strings across multiple plugins (#11879) 2026-04-19 22:37:32 +12:00
online.py replace literal HTTP codes with http.HTTPStatus (#11561) 2026-03-10 22:03:55 +01:00
opennebula.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
pacemaker.py pacemaker: fix race condition on resource creation (#11750) 2026-04-18 22:45:58 +02:00
pipx.py pipx, pipx_info: refactor (#11640) 2026-03-31 07:08:50 +02:00
pkg_req.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
puppet.py puppet: deprecate param timeout (#11658) 2026-03-23 19:57:01 +01:00
python_runner.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
redfish_utils.py fix: remove HTTPStatus constructs introduced in Python 3.11 (#11573) 2026-03-12 20:46:55 +01:00
redis.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
rundeck.py fix: remove HTTPStatus constructs introduced in Python 3.11 (#11573) 2026-03-12 20:46:55 +01:00
saslprep.py Deprecate unused module utils (#11205) 2025-11-25 06:50:06 +01:00
scaleway.py replace literal HTTP codes with http.HTTPStatus (#11561) 2026-03-10 22:03:55 +01:00
snap.py snap_connect: new module to manage snap interface connections (#11682) 2026-04-03 16:18:17 +13:00
ssh.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
systemd.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
univention_umc.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
utm_utils.py fix: remove HTTPStatus constructs introduced in Python 3.11 (#11573) 2026-03-12 20:46:55 +01:00
vardict.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
version.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
vexata.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
wdc_redfish_utils.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
xdg_mime.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
xenserver.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
xfconf.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00