import configparser


def get_config_items_ini(ini_file, section):
    """
    Get config.ini section all key->value
    [section]
    key = value

    :param ini_file:
    :param section:
    :return: (dict) key=value
    """

    kv = {}

    try:
        config = configparser.ConfigParser()
        config.read(ini_file)
        opts = config.options(section)
        for opt in opts:
            v = eval(config.get(section, opt))
            kv[opt] = v
    except Exception as e:
        raise Exception(e)
    else:
        return kv