Ejemplo n.º 1
0
def match_fs(disk, dev_path, fs_type, fs_makeopt):
    """
    Matches the user provided fs_type and fs_makeopt with the current disk.
    """
    if disk["fs_type"] != fs_type:
        return False
    elif disk["fs_mkfs"] == fs_makeopt:
        # No need to mkfs the volume, we only need to remount it
        return True
    elif fsinfo.match_mkfs_option(fs_type, dev_path, fs_makeopt):
        if disk["fs_mkfs"] != "?":
            raise Exception("mkfs option strings differ but auto-detection" " code thinks they're identical")
        else:
            return True
    else:
        return False
Ejemplo n.º 2
0
def match_fs(disk, dev_path, fs_type, fs_makeopt):
    """
    Matches the user provided fs_type and fs_makeopt with the current disk.
    """
    if disk["fs_type"] != fs_type:
        return False
    elif disk["fs_mkfs"] == fs_makeopt:
        # No need to mkfs the volume, we only need to remount it
        return True
    elif fsinfo.match_mkfs_option(fs_type, dev_path, fs_makeopt):
        if disk["fs_mkfs"] != '?':
            raise Exception("mkfs option strings differ but auto-detection"
                            " code thinks they're identical")
        else:
            return True
    else:
        return False