MCPcopy Create free account
hub / github.com/saltstack/salt / _python_shell_default

Function _python_shell_default

salt/modules/cmdmod.py:105–119  ·  view source on GitHub ↗

Set python_shell default based on the shell parameter and __opts__['cmd_safe']

(python_shell, __pub_jid)

Source from the content-addressed store, hash-verified

103
104
105def _python_shell_default(python_shell, __pub_jid):
106 """
107 Set python_shell default based on the shell parameter and __opts__['cmd_safe']
108 """
109 try:
110 # Default to python_shell=True when run directly from remote execution
111 # system. Cross-module calls won't have a jid.
112 if __pub_jid and python_shell is None:
113 return True
114 elif __opts__.get("cmd_safe", True) is False and python_shell is None:
115 # Override-switch for python_shell
116 return True
117 except NameError:
118 pass
119 return python_shell
120
121
122def _chroot_pids(chroot):

Callers 8

scriptFunction · 0.90
runFunction · 0.85
run_stdoutFunction · 0.85
run_stderrFunction · 0.85
run_allFunction · 0.85
retcodeFunction · 0.85
scriptFunction · 0.85
run_bgFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected