def generate_cfg_from_general(cfg, configs, general_config,
                              rest_excluded=False):
    if 'general' in configs:
        for nm in general_config:
            if nm not in configs['general'] and not rest_excluded:
                configs['general'][nm] = general_config[nm]['default_value']
        for name, value in configs['general'].items():
            if value:
                cfg = _set_config(cfg, general_config, name)
                LOG.debug("Applying config: {name}".format(name=name))
    else:
        cfg = _set_config(cfg, general_config)
    return cfg
dataset/ETHPy150Open openstack/sahara/sahara/plugins/spark/config_helper.py/generate_cfg_from_general/original