From b471a4a90deeab9453daaa97ecd7ef0403dac025 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 5 Nov 2025 21:49:32 +0100 Subject: [PATCH] Fix typing failure in CI (#11030) * Fix typing failure in CI. * Add changelog fragment. --- changelogs/fragments/11030-wsl-typing.yml | 2 ++ plugins/connection/wsl.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/11030-wsl-typing.yml diff --git a/changelogs/fragments/11030-wsl-typing.yml b/changelogs/fragments/11030-wsl-typing.yml new file mode 100644 index 0000000000..38d25f97e7 --- /dev/null +++ b/changelogs/fragments/11030-wsl-typing.yml @@ -0,0 +1,2 @@ +bugfixes: + - "wsl connection plugin - rename variable to fix type checking (https://github.com/ansible-collections/community.general/pull/11030)." diff --git a/plugins/connection/wsl.py b/plugins/connection/wsl.py index c6318caba4..baf8730d71 100644 --- a/plugins/connection/wsl.py +++ b/plugins/connection/wsl.py @@ -613,14 +613,14 @@ class Connection(ConnectionBase): display.vvv(f"EXEC {cmd}", host=self.get_option("remote_addr")) - cmd = to_bytes(cmd, errors="surrogate_or_strict") + cmd_b = to_bytes(cmd, errors="surrogate_or_strict") no_prompt_out = b"" no_prompt_err = b"" become_output = b"" try: - chan.exec_command(cmd) + chan.exec_command(cmd_b) if self.become and self.become.expect_prompt(): password_prompt = False become_success = False