From 1d76c2ff5fc953b7389863a91cc1850cfdcaae9b Mon Sep 17 00:00:00 2001 From: Pavel Bar Date: Sun, 15 Feb 2026 22:56:50 +0200 Subject: [PATCH] Fix deprecated imports in plugins/shell/csh.py Replace deprecated module_utils imports: - ansible.module_utils.six.text_type -> str - ansible.module_utils.six.moves.shlex_quote -> shlex.quote Fixes #686 Co-authored-by: Cursor AI Signed-off-by: Pavel Bar --- plugins/shell/csh.py | 5 ++--- tests/sanity/ignore-2.21.txt | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/shell/csh.py b/plugins/shell/csh.py index 9baae25..3b2e28f 100644 --- a/plugins/shell/csh.py +++ b/plugins/shell/csh.py @@ -13,8 +13,7 @@ DOCUMENTATION = ''' - shell_common ''' -from ansible.module_utils.six import text_type -from ansible.module_utils.six.moves import shlex_quote +from shlex import quote as shlex_quote from ansible.plugins.shell import ShellBase @@ -43,5 +42,5 @@ class ShellModule(ShellBase): ret = [] # All the -u options must be first, so we process them first ret += ['-u %s' % k for k, v in kwargs.items() if v is None] - ret += ['%s=%s' % (k, shlex_quote(text_type(v))) for k, v in kwargs.items() if v is not None] + ret += ['%s=%s' % (k, shlex_quote(str(v))) for k, v in kwargs.items() if v is not None] return 'env %s' % ' '.join(ret) diff --git a/tests/sanity/ignore-2.21.txt b/tests/sanity/ignore-2.21.txt index 17e042d..62cea54 100644 --- a/tests/sanity/ignore-2.21.txt +++ b/tests/sanity/ignore-2.21.txt @@ -1,5 +1,4 @@ tests/utils/shippable/timing.py shebang -plugins/shell/csh.py pylint:ansible-bad-import-from plugins/shell/fish.py pylint:ansible-bad-import-from tests/unit/mock/procenv.py pylint:ansible-bad-import-from tests/unit/mock/yaml_helper.py pylint:ansible-bad-import-from