Skip to content

Commit

Permalink
Delete conda_exec_home instead of env['HOME']
Browse files Browse the repository at this point in the history
This should always be the same in the current code, but this feels a
little safer, given that env is mutable.
  • Loading branch information
mvdbeek committed Jul 31, 2017
1 parent e43a12a commit 81af55c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/tools/deps/conda_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,14 @@ def exec_command(self, operation, args):
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
conda_exec_home = 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)
shutil.rmtree(conda_exec_home, ignore_errors=True)

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

0 comments on commit 81af55c

Please sign in to comment.