Set python_shell default based on the shell parameter and __opts__['cmd_safe']
(python_shell, __pub_jid)
| 103 | |
| 104 | |
| 105 | def _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 | |
| 122 | def _chroot_pids(chroot): |
no test coverage detected