Commit 264ca512 authored by Jérome Perrin's avatar Jérome Perrin

Don't reset PYTHONPATH

With slapos!862 we no longer need this

See merge request !270
parents 49f8aaa5 c83bb10e
......@@ -711,7 +711,6 @@ class StandaloneSlapOS(object):
return subprocess.check_call(
command,
shell=True,
env=self._getSubprocessEnvironment(),
)
except subprocess.CalledProcessError as e:
if e.returncode == SLAPGRID_PROMISE_FAIL:
......@@ -775,7 +774,6 @@ class StandaloneSlapOS(object):
output = subprocess.check_output(
['supervisord', '--configuration', self._supervisor_config],
cwd=self._base_directory,
env=self._getSubprocessEnvironment(),
)
self._logger.debug("Started new supervisor: %s", output)
......@@ -806,14 +804,3 @@ class StandaloneSlapOS(object):
return
time.sleep(i * .01)
raise RuntimeError("SlapOS not started")
def _getSubprocessEnvironment(self):
# Running tests with `python setup.py test` sets a PYTHONPATH that
# is suitable for current python, but problematic when this process
# runs another version of python in subprocess.
if 'PYTHONPATH' in os.environ:
self._logger.warning(
"Removing $PYTHONPATH from environment for subprocess")
env = os.environ.copy()
del env['PYTHONPATH']
return env
......@@ -219,8 +219,7 @@ class CrontabMixin(object):
"""
crontab_command = self._getCrontabCommand(crontab_name)
crontab_output = subprocess.check_output(
# XXX we unset PYTHONPATH set by `setup.py test`
"env PYTHONPATH= faketime {date} bash -o pipefail -e -c '{crontab_command}'".format(**locals()),
"faketime {date} bash -o pipefail -e -c '{crontab_command}'".format(**locals()),
shell=True,
)
self.logger.debug("crontab %s output: %s", crontab_command, crontab_output)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment