1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 09:47:58 +00:00

mount: check llfuse is installed before asking for passphrase

This commit is contained in:
Marian Beermann 2017-05-21 11:24:09 +02:00
parent 1cd90b2c86
commit e689d8f2f6

View file

@ -1229,15 +1229,20 @@ def _delete_repository(self, args, repository):
logger.info("Cache deleted.") logger.info("Cache deleted.")
return self.exit_code return self.exit_code
@with_repository() def do_mount(self, args):
def do_mount(self, args, repository, manifest, key):
"""Mount archive or an entire repository as a FUSE filesystem""" """Mount archive or an entire repository as a FUSE filesystem"""
try: try:
from .fuse import FuseOperations import borg.fuse
except ImportError as e: except ImportError as e:
self.print_error('Loading fuse support failed [ImportError: %s]' % str(e)) self.print_error('borg mount not available: loading fuse support failed [ImportError: %s]' % str(e))
return self.exit_code return self.exit_code
return self._do_mount(args)
@with_repository()
def _do_mount(self, args, repository, manifest, key):
from .fuse import FuseOperations
if not os.path.isdir(args.mountpoint) or not os.access(args.mountpoint, os.R_OK | os.W_OK | os.X_OK): if not os.path.isdir(args.mountpoint) or not os.access(args.mountpoint, os.R_OK | os.W_OK | os.X_OK):
self.print_error('%s: Mountpoint must be a writable directory' % args.mountpoint) self.print_error('%s: Mountpoint must be a writable directory' % args.mountpoint)
return self.exit_code return self.exit_code