Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
def umount(path):
    """useraufs-umount <path>"""
    if not is_mounted(path):
        return False

    command("useraufs-umount", path)
    return True
Esempio n. 4
0
def umount(path):
    """useraufs-umount <path>"""
    if not is_mounted(path):
        return False

    command("useraufs-umount", path)
    return True
Esempio n. 5
0
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
Esempio n. 6
0
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
Esempio n. 7
0
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
Esempio n. 8
0
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