Skip to content

[PR #1197/dd4ca7a8 backport][stable-5] Remove remaining ansible.module_utils.six import from kubectl connection plugin - #1199

Open
patchback[bot] wants to merge 1 commit into
stable-5from
patchback/backports/stable-5/dd4ca7a8b05deb196e790426426147c43175170c/pr-1197
Open

[PR #1197/dd4ca7a8 backport][stable-5] Remove remaining ansible.module_utils.six import from kubectl connection plugin#1199
patchback[bot] wants to merge 1 commit into
stable-5from
patchback/backports/stable-5/dd4ca7a8b05deb196e790426426147c43175170c/pr-1197

Conversation

@patchback

@patchback patchback Bot commented Jul 31, 2026

Copy link
Copy Markdown

This is a backport of PR #1197 as merged into main (dd4ca7a).

SUMMARY

#998 removed the ansible.module_utils.six imports, but plugins/connection/kubectl.py was missed and still imports the shim. This replaces it with the stdlib equivalent:

-from ansible.module_utils.six.moves import shlex_quote
+from shlex import quote as shlex_quote

On Python 3 six.moves.shlex_quote is already shlex.quote (the same function object), so there is no behaviour change at the single call site in put_file(). The import is placed in the stdlib group to keep tox -e linters clean.

ansible.module_utils.six is deprecated in ansible-core 2.21 and scheduled for removal in 2.24.

ISSUE TYPE
  • Refactoring Pull Request
COMPONENT NAME

plugins/connection/kubectl.py

…ction plugin (#1197)

* Replace ansible.module_utils.six with Python stdlib equivalents

ansible.module_utils.six is deprecated in ansible-core 2.21 and is
scheduled for removal in 2.24. Every use of it in this collection has a
direct Python 3 standard library equivalent, so switch to those.

* Update changelogs/fragments/20260723-remove-module-utils-six.yaml

Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>

---------

Co-authored-by: Bikouo Aubin <79859644+abikouo@users.noreply.github.com>
(cherry picked from commit dd4ca7a)
@sonarqubecloud

Copy link
Copy Markdown

@centosinfra-prod-github-app

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-all-the-targets In order to tell to the integration test splitter to test all targets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants