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): ...@@ -711,7 +711,6 @@ class StandaloneSlapOS(object):
return subprocess.check_call( return subprocess.check_call(
command, command,
shell=True, shell=True,
env=self._getSubprocessEnvironment(),
) )
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
if e.returncode == SLAPGRID_PROMISE_FAIL: if e.returncode == SLAPGRID_PROMISE_FAIL:
...@@ -775,7 +774,6 @@ class StandaloneSlapOS(object): ...@@ -775,7 +774,6 @@ class StandaloneSlapOS(object):
output = subprocess.check_output( output = subprocess.check_output(
['supervisord', '--configuration', self._supervisor_config], ['supervisord', '--configuration', self._supervisor_config],
cwd=self._base_directory, cwd=self._base_directory,
env=self._getSubprocessEnvironment(),
) )
self._logger.debug("Started new supervisor: %s", output) self._logger.debug("Started new supervisor: %s", output)
...@@ -806,14 +804,3 @@ class StandaloneSlapOS(object): ...@@ -806,14 +804,3 @@ class StandaloneSlapOS(object):
return return
time.sleep(i * .01) time.sleep(i * .01)
raise RuntimeError("SlapOS not started") 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): ...@@ -219,8 +219,7 @@ class CrontabMixin(object):
""" """
crontab_command = self._getCrontabCommand(crontab_name) crontab_command = self._getCrontabCommand(crontab_name)
crontab_output = subprocess.check_output( crontab_output = subprocess.check_output(
# XXX we unset PYTHONPATH set by `setup.py test` "faketime {date} bash -o pipefail -e -c '{crontab_command}'".format(**locals()),
"env PYTHONPATH= faketime {date} bash -o pipefail -e -c '{crontab_command}'".format(**locals()),
shell=True, shell=True,
) )
self.logger.debug("crontab %s output: %s", crontab_command, crontab_output) 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