Skip to content

Commit

Permalink
Set $HOME to a temp directory rather than conda_prefix because
Browse files Browse the repository at this point in the history
conda_prefix may not be writable either.
  • Loading branch information
natefoo committed Mar 2, 2017
1 parent d3840c5 commit 4fa76ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/galaxy/tools/deps/conda_util.py
Expand Up @@ -215,16 +215,19 @@ def command(self, operation, args):

def exec_command(self, operation, args):
command = self.command(operation, args)
env = {'HOME': self.conda_prefix} # We don't want to pollute ~/.conda, which may not even be writable
env = {}
condarc_override = self.condarc_override
if condarc_override:
env["CONDARC"] = condarc_override
log.debug("Executing command: %s", command)
env['HOME'] = tempfile.mkdtemp(prefix='conda_exec_home_') # We don't want to pollute ~/.conda, which may not even be writable
try:
return self.shell_exec(command, env=env)
except commands.CommandLineException as e:
log.warning(e)
return e.returncode
finally:
shutil.rmtree(env['HOME'], ignore_errors=True)

def exec_create(self, args):
create_base_args = [
Expand Down

0 comments on commit 4fa76ca

Please sign in to comment.