From 084ecd96e1a34bc8a3dd96bc0438461748f3a103 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 23 Nov 2025 08:58:35 +0100 Subject: [PATCH] [PR #11190/9a3e26ad backport][stable-12] fix ruff case SIM112 (#11194) fix ruff case SIM112 (#11190) (cherry picked from commit 9a3e26ad98c2ff70ba8cf4cfe755611078de6d2c) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- changelogs/fragments/11190-ruff-cases-7.yml | 2 ++ plugins/connection/wsl.py | 2 +- ruff.toml | 1 - tests/integration/targets/connection_wsl/runme.sh | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/11190-ruff-cases-7.yml diff --git a/changelogs/fragments/11190-ruff-cases-7.yml b/changelogs/fragments/11190-ruff-cases-7.yml new file mode 100644 index 0000000000..ce79cb959a --- /dev/null +++ b/changelogs/fragments/11190-ruff-cases-7.yml @@ -0,0 +1,2 @@ +minor_changes: + - wsl connection plugin - adjust variable name for integration tests (https://github.com/ansible-collections/community.general/pull/11190). diff --git a/plugins/connection/wsl.py b/plugins/connection/wsl.py index 4a37e8c601..9e792b22ea 100644 --- a/plugins/connection/wsl.py +++ b/plugins/connection/wsl.py @@ -587,7 +587,7 @@ class Connection(ConnectionBase): args.extend(["--user", wsl_user]) args.extend(["--"]) args.extend(shlex.split(cmd)) - if os.getenv("_ANSIBLE_TEST_WSL_CONNECTION_PLUGIN_Waeri5tepheeSha2fae8"): + if os.getenv("_ANSIBLE_TEST_WSL_CONNECTION_PLUGIN_WAERI5TEPHEESHA2FAE8"): return shlex.join(args) return list2cmdline(args) # see https://github.com/python/cpython/blob/3.11/Lib/subprocess.py#L576 diff --git a/ruff.toml b/ruff.toml index 093f5a2ecc..a69359d815 100644 --- a/ruff.toml +++ b/ruff.toml @@ -28,7 +28,6 @@ ignore = [ "B026", # star-arg-unpacking-after-keyword-arg "SIM102", # collapsible-if "SIM110", # reimplemented-builtin - "SIM112", # uncapitalized-environment-variables "SIM114", # if-with-same-arms "SIM115", # open-file-with-context-handler "SIM116", # if-else-block-instead-of-dict-lookup diff --git a/tests/integration/targets/connection_wsl/runme.sh b/tests/integration/targets/connection_wsl/runme.sh index cb1e5b9cd0..f230460b56 100755 --- a/tests/integration/targets/connection_wsl/runme.sh +++ b/tests/integration/targets/connection_wsl/runme.sh @@ -11,7 +11,7 @@ set -eux # NB while running integration tests, the mock wsl.exe implementation is actually # running on unix, instead of on running windows, so the wsl.exe command line # construction must use unix rules instead of windows rules. -export _ANSIBLE_TEST_WSL_CONNECTION_PLUGIN_Waeri5tepheeSha2fae8=1 +export _ANSIBLE_TEST_WSL_CONNECTION_PLUGIN_WAERI5TEPHEESHA2FAE8=1 ANSIBLE_ROLES_PATH=../ \ ansible-playbook dependencies.yml -v "$@"