Allow disabling sandboxing on the python runner level
@@ -74,7 +74,7 @@ def get_runner(config=None):
class PythonRunner(ActionRunner):
- def __init__(self, runner_id, config=None, timeout=PYTHON_RUNNER_DEFAULT_ACTION_TIMEOUT):
+ def __init__(self, runner_id, config=None, timeout=PYTHON_RUNNER_DEFAULT_ACTION_TIMEOUT, sandbox=True):
"""
:param timeout: Action execution timeout in seconds.
:type timeout: ``int``
@@ -82,6 +82,7 @@ class PythonRunner(ActionRunner):
super(PythonRunner, self).__init__(runner_id=runner_id)
self._config = config
self._timeout = timeout
+ self._sandbox = sandbox
def pre_run(self):
super(PythonRunner, self).pre_run()
@@ -102,7 +103,10 @@ class PythonRunner(ActionRunner):
LOG.debug('Getting virtualenv_path.')
virtualenv_path = get_sandbox_virtualenv_path(pack=pack)
LOG.debug('Getting python path.')
+ if self.sandbox:
python_path = get_sandbox_python_binary_path(pack=pack)
+ else:
+ python_path = sys.executable
LOG.debug('Checking virtualenv path.')
if virtualenv_path and not os.path.isdir(virtualenv_path):
