-def unmount_all(path, timeout=10):
- if not path.endswith("/..."):
- return unmount(path, timeout=timeout)
- root = os.path.realpath(path[:-4])
-
- paths = []
- for m in mountinfo():
- if m.path == root or m.path.startswith(root+"/"):
- paths.append(m.path)
- if not m.is_fuse:
- raise Exception(
- "cannot unmount {}: non-fuse mountpoint {}".format(
- path, m))
- for path in sorted(paths, key=len, reverse=True):
- unmount(path, timeout=timeout)
- return len(paths) > 0
-
-
-def unmount(path, timeout=10):
+def unmount(path, subtype=None, timeout=10, recursive=False):