remove the specified configuration

def remove(name=None, index=None):
    """
    remove the specified configuration

    """

    removed = False
    count = 1
    for configuration in _CONFIG.sections():
        if index != None:
            if count == index:
                _CONFIG.remove_section(configuration)
                removed = True
                break

        if name != None:
            if configuration == name:
                _CONFIG.remove_section(configuration)
                removed = True
                break

        count += 1

    if not removed:
        raise JutException('Unable to find %s configuration' % name)

    with open(_CONFIG_FILEPATH, 'w') as configfile:
        _CONFIG.write(configfile)