Skip to content
Snippets Groups Projects
Commit b1328ba7 authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

ipareplica: Don't rely on pkg_resources whenever possible


Python's module "pkg_resources" API has been deprecated in Python 3.12
and will be removed in a future release, and recent FreeIPA versions
provide a replacement for pkg_resources.parse_version.

To remove ansible-freeipa dependency on pkg_resources and not add a
dependency on the 'packaging' module, which is not available in the
standard Python distribution, we'll try to import the funcion used in
FreeIPA to parse versions, and fallback to pkg_resources when it fails.

As an equivalent class is needed, a fallback function is not provided
and execution will fail if neither the FreeIPA nor the pkg_resources
parse_version function are available.

Signed-off-by: default avatarRafael Guterres Jeffman <rjeffman@redhat.com>
parent fe58f3a8
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment