mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-01 12:45:34 +00:00
Merge pull request #7498 from ThomasWaldmann/mount-dir-check-master
mount: improve mountpoint error msgs, see #7496
This commit is contained in:
commit
6662b8dadb
1 changed files with 6 additions and 2 deletions
|
@ -24,8 +24,12 @@ def do_mount(self, args):
|
|||
self.print_error("borg mount not available: no FUSE support, BORG_FUSE_IMPL=%s." % BORG_FUSE_IMPL)
|
||||
return self.exit_code
|
||||
|
||||
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)
|
||||
if not os.path.isdir(args.mountpoint):
|
||||
self.print_error(f"{args.mountpoint}: Mountpoint must be an **existing directory**")
|
||||
return self.exit_code
|
||||
|
||||
if not os.access(args.mountpoint, os.R_OK | os.W_OK | os.X_OK):
|
||||
self.print_error(f"{args.mountpoint}: Mountpoint must be a **writable** directory")
|
||||
return self.exit_code
|
||||
|
||||
return self._do_mount(args)
|
||||
|
|
Loading…
Reference in a new issue