From c8a2c5ed0d3a0953505e49f1b44f2868e8f6363f Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 21 Nov 2025 14:46:02 -0800 Subject: [PATCH] Skip injection w/o version --- test/lib/ansible_test/_internal/util_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lib/ansible_test/_internal/util_common.py b/test/lib/ansible_test/_internal/util_common.py index d60b465aa79..0d24054798d 100644 --- a/test/lib/ansible_test/_internal/util_common.py +++ b/test/lib/ansible_test/_internal/util_common.py @@ -499,13 +499,13 @@ def get_powershell_injector_env( """Get the environment variables needed to inject the given PowerShell interpreter into the environment.""" env = env.copy() - if not powershell or not powershell.path: + if not powershell or not powershell.path or not powershell.version: return env # FIXME: how should the absence of pwsh and/or no powershell version specified be handled? powershell_path = get_powershell_path(powershell.path) env['PATH'] = os.path.pathsep.join([powershell_path, env['PATH']]) - env['ANSIBLE_TEST_POWERSHELL_VERSION'] = powershell.version or '' # FIXME: what to do with no version? + env['ANSIBLE_TEST_POWERSHELL_VERSION'] = powershell.version env['ANSIBLE_TEST_POWERSHELL_INTERPRETER'] = powershell.path return env