Example #1
0
def load_job_config_from_package_recursive(p, loaded, configs):
    if p in loaded:
        return
    loaded[p] = True
    c = load_config_from_package(p, 'config/job.yml')
    INFO("load job config from package: %s\n%s" % (p, c))
    if not c:
        return
    if 'dependencies' in c:
        for d in c['dependencies']:
            load_job_config_from_package_recursive(d, loaded, configs)
    configs.append(c)
Example #2
0
    def run_service(self, service, addr, run_server, attr):
        if attr:
            if not 'name' in attr:
                attr['name'] = service

            if attr.get('module'):
                pc = config_utils.load_config_from_package(attr['module'], 'config/service.yml')
                if pc:
                    d = pc['services'].get(service, {})
                    attr = dict_utils.extend(d, attr)

        for e in get_etcd_list():
            r = run_etcd_service(e, service, addr, run_server, attr)
            return r