use prepared env for borg umount

This commit is contained in:
Thomas Waldmann 2017-09-23 22:38:26 +02:00
parent 6da5bf4b85
commit b88da10641
1 changed files with 5 additions and 2 deletions

View File

@ -6,6 +6,8 @@ import subprocess
import sys
import textwrap
from .process import prepare_subprocess_env
from ..constants import * # NOQA
@ -154,7 +156,8 @@ def dash_open(path, mode):
def umount(mountpoint):
env = prepare_subprocess_env(system=True)
try:
return subprocess.call(['fusermount', '-u', mountpoint])
return subprocess.call(['fusermount', '-u', mountpoint], env=env)
except FileNotFoundError:
return subprocess.call(['umount', mountpoint])
return subprocess.call(['umount', mountpoint], env=env)