From 8ba77816be13a71531d9cb07614716cd4da20780 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thibaut=20VAR=C3=88NE?= Date: Fri, 22 Jun 2018 14:25:17 +0200 Subject: [PATCH] phase1: move do_cleanup to slave properties MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thibaut VARÈNE --- phase1/master.cfg | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/phase1/master.cfg b/phase1/master.cfg index b4da1ad..a4e21da 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -49,21 +49,19 @@ if ini.has_option("general", "port"): 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 @@ -230,8 +228,8 @@ def IsMakeCleanRequested(pattern): 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 @@ -253,9 +251,9 @@ def IsNoMasterBuild(step): 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 -- 2.30.2