def _convert2dict(file_content_lines):
    """
    Convert the corosync configuration file to a dictionary
    """
    corodict = {}
    index = 0

    for i, line in enumerate(file_content_lines):
        stripped_line = line.strip()
        if not stripped_line or stripped_line[0] == '#':
            continue

        if index > i:
            continue

        line_items = stripped_line.split()
        if '{' in stripped_line:
            corodict[line_items[0]], new_index = _convert2dict(file_content_lines[i+1:])
            index = i + new_index
        elif line_items[0][-1] == ':':
            corodict[line_items[0][:-1]] = line_items[-1]
        elif '}' in stripped_line:
            return corodict, i+2

    return corodict, index