def remount(operations, path): """useraufs-remount <operation[s]> <path> <operations> can be a tuple, a list or a string.""" if not isinstance(operations, (list, tuple)): operations = [ operations ] command("useraufs-remount", path, *operations)
def remount(operations, path): """useraufs-remount <operation[s]> <path> <operations> can be a tuple, a list or a string.""" if not isinstance(operations, (list, tuple)): operations = [operations] command("useraufs-remount", path, *operations)
def umount(path): """useraufs-umount <path>""" if not is_mounted(path): return False command("useraufs-umount", path) return True
def mount(branches, path): """useraufs-mount <branch[es]> to <path> <branches> can be a tuple, a list or a string.""" if is_mounted(path): return False if not isinstance(branches, (list, tuple)): branches = [ branches ] command("useraufs-mount", "--udba=reval", path, *branches) return True
def mount(branches, path): """useraufs-mount <branch[es]> to <path> <branches> can be a tuple, a list or a string.""" if is_mounted(path): return False if not isinstance(branches, (list, tuple)): branches = [branches] command("useraufs-mount", "--udba=reval", path, *branches) return True
def is_mounted(path): """parse useraufs-show output to determine if <path> is mounted""" path = os.path.realpath(path) unions = [ line.split("\t") for line in command("useraufs-show").split("\n") if line ] for branches, mnt in unions: if mnt == path: return True return False