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