c['slaves'] = []
max_builds = dict()
-do_cleanup = 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, }
+ sl_props = { 'dl_lock':None, 'ul_lock':None, 'do_cleanup':False }
name = ini.get(section, "name")
password = ini.get(section, "password")
max_builds[name] = 1
- do_cleanup[name] = False
if ini.has_option(section, "builds"):
max_builds[name] = ini.getint(section, "builds")
if ini.has_option(section, "cleanup"):
- do_cleanup[name] = ini.getboolean(section, "cleanup")
+ sl_props['do_cleanup'] = ini.getboolean(section, "cleanup")
if ini.has_option(section, "dl_lock"):
lockname = ini.get(section, "dl_lock")
sl_props['dl_lock'] = lockname
return CheckCleanProperty
def IsCleanupRequested(step):
- val = step.getProperty("slavename")
- if val and do_cleanup[val]:
+ do_cleanup = step.getProperty("do_cleanup")
+ if do_cleanup:
return True
else:
return False
return repo_branch != "master"
def IsCleanupConfigured(step):
- slave = step.getProperty("slavename")
- if slave and slave in do_cleanup:
- return do_cleanup[slave] > 0
+ do_cleanup = step.getProperty("do_cleanup")
+ if do_cleanup:
+ return do_cleanup > 0
else:
return False