def disable_engine(name, cfg_file):
    engines = load_yaml(cfg_file)
    if not engines:
        raise exceptions.NoEnginesException("No known engine!")
    if name not in engines:
        raise exceptions.NoSuchEngineException("No engines called %s!", name)
    engines[name]['enabled'] = False
    write_yaml(engines, cfg_file, append=False)
    return engines[name]['pid']
dataset/ETHPy150Open openstack/entropy/entropy/utils.py/disable_engine/original