Remove ansible-core 2.20 deprecated imports#1400
Draft
rjeffman wants to merge 1 commit into
Draft
Conversation
rjeffman
force-pushed
the
python3_only_playground
branch
2 times, most recently
from
November 11, 2025 18:21
6e89fcc to
e2baf9b
Compare
This commit removes all dependencies on the 'asible.module_util.six' module and fixes deprecated imports as defined by the ansible-core release version 2.20. This changes render ansible-freeipa collection incompatible with Python 2. Changes include: * Remove six module imports from all modules and roles - Removed 'from ansible.module_utils import six' statements - Removed 'from ansible.module_utils.six.moves' imports * Replace and remove Python version checks (six.PY3 and six.PY2) * Replace unicode usage with to_text or str * Ensure text conversion routines imports are consistent and are imported from Ansible common.text.converters * Update standard library imports - Changed 'six.moves.urllib.parse' to 'urllib.parse' - Changed 'six.moves.configparser' to 'ConfigParser' - Import 'Mapping' from 'collections.abc' * Remove Python 2 specific code Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
rjeffman
force-pushed
the
python3_only_playground
branch
from
February 4, 2026 17:56
e2baf9b to
03691e6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch removes all dependencies on the 'asible.module_util.six'
module and fixes deprecated imports as defined by the ansible-core
release version 2.20.
This changes render ansible-freeipa collection incompatible with
Python 2.
Changes include:
Remove six module imports from all modules and roles
Replace and remove Python version checks (six.PY3 and six.PY2)
Replace unicode usage with to_text or str
Ensure text conversion routines imports are consistent and are
imported from Ansible common.text.converters
Update standard library imports
Remove Python 2 specific code
Note that this change only addresses the deprecation issues
with ansible-core 2.20. For full migration from Python 2 the
minimum supported IPA version should be 4.9, that currently targets
Python 3.6.
Fixes #1399
Summary by Sourcery
Remove deprecated ansible.module_utils.six usage and Python 2 compatibility code to comply with ansible-core 2.20 deprecations.
Enhancements: