From 513d50192d74f963f8611ba82483fcff75b497b3 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/fish.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/fish.py | 5 ++--- tests/sanity/ignore-2.21.txt | 1 - tests/sanity/ignore-2.22.txt | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/shell/fish.py b/plugins/shell/fish.py index b96efa5..43b1463 100644 --- a/plugins/shell/fish.py +++ b/plugins/shell/fish.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.sh import ShellModule as ShModule @@ -42,7 +41,7 @@ class ShellModule(ShModule): if v is None: ret.append('set -e %s;' % k) else: - ret.append('set -lx %s %s;' % (k, shlex_quote(text_type(v)))) + ret.append('set -lx %s %s;' % (k, shlex_quote(str(v)))) return ' '.join(ret) def build_module_command(self, env_string, shebang, cmd, arg_path=None): diff --git a/tests/sanity/ignore-2.21.txt b/tests/sanity/ignore-2.21.txt index 494f71e..a1f3f9c 100644 --- a/tests/sanity/ignore-2.21.txt +++ b/tests/sanity/ignore-2.21.txt @@ -1,4 +1,3 @@ -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 tests/unit/modules/conftest.py pylint:ansible-bad-import-from diff --git a/tests/sanity/ignore-2.22.txt b/tests/sanity/ignore-2.22.txt index 494f71e..a1f3f9c 100644 --- a/tests/sanity/ignore-2.22.txt +++ b/tests/sanity/ignore-2.22.txt @@ -1,4 +1,3 @@ -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 tests/unit/modules/conftest.py pylint:ansible-bad-import-from