Skip to content

Commit 1df479e

Browse files
authored
Use versioned python interpreter for salt-ssh
1 parent 6a57e82 commit 1df479e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

salt/client/ssh/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
if [ -n "$DEBUG" ]
158158
then set -x
159159
fi
160-
PYTHON_CMDS="/var/tmp/venv-salt-minion/bin/python python3.11 python3 /usr/libexec/platform-python python27 python2.7 python26 python2.6 python2 python"
160+
PYTHON_CMDS="/var/tmp/venv-salt-minion/bin/python {{PY3XX_CMD}}python3 /usr/libexec/platform-python python27 python2.7 python26 python2.6 python2 python"
161161
for py_cmd in $PYTHON_CMDS
162162
do
163163
if command -v "$py_cmd" >/dev/null 2>&1 && "$py_cmd" -c "import sys; sys.exit(not (sys.version_info >= (2, 6)));"
@@ -1533,6 +1533,7 @@ def _cmd_str(self):
15331533
SSH_PY_CODE=py_code_enc,
15341534
HOST_PY_MAJOR=sys.version_info[0],
15351535
SET_PATH=self.set_path,
1536+
PY3XX_CMD=f"python3.{sys.version_info.minor} " if sys.version_info >= (3, 11) else "",
15361537
)
15371538
else:
15381539
cmd = saltwinshell.gen_shim(py_code_enc)

0 commit comments

Comments
 (0)