slave_port = ini.getint("general", "port")
c['slaves'] = []
-max_builds = dict()
NetLocks = dict()
for section in ini.sections():
if section.startswith("slave "):
if ini.has_option(section, "name") and ini.has_option(section, "password"):
- sl_props = { 'dl_lock':None, 'ul_lock':None, 'do_cleanup':False }
+ sl_props = { 'dl_lock':None, 'ul_lock':None, 'do_cleanup':False, 'max_builds':1 }
name = ini.get(section, "name")
password = ini.get(section, "password")
- max_builds[name] = 1
+ max_builds = 1
if ini.has_option(section, "builds"):
- max_builds[name] = ini.getint(section, "builds")
+ max_builds = ini.getint(section, "builds")
+ sl_props['max_builds'] = max_builds
if ini.has_option(section, "cleanup"):
sl_props['do_cleanup'] = ini.getboolean(section, "cleanup")
if ini.has_option(section, "dl_lock"):
sl_props['ul_lock'] = lockname
if lockname not in NetLocks:
NetLocks[lockname] = locks.MasterLock(lockname)
- c['slaves'].append(BuildSlave(name, password, max_builds = max_builds[name], properties = sl_props))
+ c['slaves'].append(BuildSlave(name, password, max_builds = max_builds, properties = sl_props))
# 'slavePortnum' defines the TCP port to listen on for connections from slaves.
# This must match the value configured into the buildslaves (with their
return ""
def GetNumJobs(props):
- if props.hasProperty("slavename") and props.hasProperty("nproc"):
- return (int(props["nproc"]) / (max_builds[props["slavename"]] + other_builds))
+ if props.hasProperty("max_builds") and props.hasProperty("nproc"):
+ return (int(props["nproc"]) / (props["max_builds"] + other_builds))
else:
return 1