def split_nodelist(nodelist):
    """
    split_nodelist takes a compressed hostlist string and returns an array of
    individual components but leaves expansion []s in place.
    :param: nodelist: The hostlist string.
    :return: An array of components with expansions in place.
    """
    line = nodelist.replace(',', ' ')
    add_comma = False
    index = 0
    for char in line:
        if char in '[':
            add_comma = True
        if char in ']':
            add_comma = False
        if char in ' ' and add_comma:
            line = line[:index] + ',' + line[index+1:]
        index = index + 1
    return line.split(' ')