[BUG] [onedir] cmd.run runas cannot get environment #62565
Labels
Bug
broken, incorrect, or confusing behavior
needs-triage
Phosphorus v3005.0
Release code name and version
Regression
The issue is a bug that breaks functionality known to work in previous releases.
Milestone
Description
cmdmod.run
usessys.executable
to execute some dynamic Python code to get the environment of the user the command should run as. Seesalt/salt/modules/cmdmod.py
Lines 524 to 535 in 4bbdd65
This does not work in tiamat / onedir installations since
sys.executable
is/opt/saltstack/salt/run/run
and/opt/saltstack/salt/run/run
cannot handle piped in Python code.Steps to Reproduce the behavior
salt-call cmd.run id runas=root
Expected behavior
No error message. Salt is able to pick up the environment variables defined for the user.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
Other code is using
sys.executable
, too. These other occurrences must be fixed, too. If they just open a Python file, they can use/opt/saltstack/salt/run/run python
for that.The text was updated successfully, but these errors were encountered: