Example #1
0
def create_master_config(config_dict):
    try:
        master_config = MasterConfig()
        filename = None
        master_config.load_global(filename, config_dict)
        master_config.load_validation(filename, config_dict)
        master_config.load_db(filename, config_dict)
        master_config.load_mq(filename, config_dict)
        master_config.load_metrics(filename, config_dict)
        master_config.load_caches(filename, config_dict)
        master_config.load_schedulers(filename, config_dict)
        master_config.load_builders(filename, config_dict)
        master_config.load_workers(filename, config_dict)
        master_config.load_change_sources(filename, config_dict)
        master_config.load_status(filename, config_dict)
        master_config.load_user_managers(filename, config_dict)
        master_config.load_www(filename, config_dict)
        master_config.load_services(filename, config_dict)
        # run some sanity checks
        master_config.check_single_master()
        master_config.check_schedulers()
        master_config.check_locks()
        master_config.check_builders()
        master_config.check_status()
        master_config.check_horizons()
        master_config.check_ports()
    except Exception as e:
        raise Exception("Could not reconfigure Buildbot: " + str(e))
    return master_config