From 05d9842e77941bd165c7658987de16b0ddbfc62d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thibaut=20VAR=C3=88NE?= Date: Thu, 20 Oct 2022 19:24:56 +0200 Subject: [PATCH] phase1: reorder/regroup globals MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thibaut VARÈNE --- phase1/master.cfg | 68 ++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/phase1/master.cfg b/phase1/master.cfg index 2e5076e..9c88daf 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -56,6 +56,41 @@ if "general" not in ini or "phase1" not in ini or "rsync" not in ini: inip1 = ini['phase1'] +# Globals +work_dir = os.path.abspath(ini['general'].get("workdir", ".")) +scripts_dir = os.path.abspath("../scripts") + +config_seed = inip1.get("config_seed", "") + +repo_url = ini['repo'].get("url") +repo_branch = ini['repo'].get("branch", "master") + +rsync_bin_url = ini['rsync'].get("binary_url") +rsync_bin_key = ini['rsync'].get("binary_password") +rsync_bin_defopts = ["-v", "-4", "--timeout=120"] + +if rsync_bin_url.find("::") > 0 or rsync_bin_url.find("rsync://") == 0: + rsync_bin_defopts += ["--contimeout=20"] + +rsync_src_url = ini['rsync'].get("source_url") +rsync_src_key = ini['rsync'].get("source_password") +rsync_src_defopts = ["-v", "-4", "--timeout=120"] + +if rsync_src_url.find("::") > 0 or rsync_src_url.find("rsync://") == 0: + rsync_src_defopts += ["--contimeout=20"] + +usign_key = None +usign_comment = "untrusted comment: " + repo_branch.replace("-", " ").title() + " key" + +if ini.has_section("usign"): + usign_key = ini['usign'].get("key") + usign_comment = ini['usign'].get("comment", usign_comment) + +enable_kmod_archive = inip1.getboolean("kmod_archive", False) + +# PB port can be either a numeric port or a connection string +pb_port = inip1.get("port") or 9989 + # This is the dictionary that the buildmaster pays attention to. We also use # a shorter alias to save typing. c = BuildmasterConfig = {} @@ -105,8 +140,6 @@ for section in ini.sections(): NetLocks[lockname] = locks.MasterLock(lockname) c['workers'].append(Worker(name, password, max_builds = 1, properties = sl_props)) -# PB port can be either a numeric port or a connection string -pb_port = inip1.get("port") or 9989 c['protocols'] = {'pb': {'port': pb_port}} # coalesce builds @@ -197,37 +230,6 @@ c['prioritizeBuilders'] = prioritizeBuilders ####### CHANGESOURCES -work_dir = os.path.abspath(ini['general'].get("workdir", ".")) -scripts_dir = os.path.abspath("../scripts") - -config_seed = inip1.get("config_seed", "") - -repo_url = ini['repo'].get("url") -repo_branch = ini['repo'].get("branch", "master") - -rsync_bin_url = ini['rsync'].get("binary_url") -rsync_bin_key = ini['rsync'].get("binary_password") -rsync_bin_defopts = ["-v", "-4", "--timeout=120"] - -if rsync_bin_url.find("::") > 0 or rsync_bin_url.find("rsync://") == 0: - rsync_bin_defopts += ["--contimeout=20"] - -rsync_src_url = ini['rsync'].get("source_url") -rsync_src_key = ini['rsync'].get("source_password") -rsync_src_defopts = ["-v", "-4", "--timeout=120"] - -if rsync_src_url.find("::") > 0 or rsync_src_url.find("rsync://") == 0: - rsync_src_defopts += ["--contimeout=20"] - -usign_key = None -usign_comment = "untrusted comment: " + repo_branch.replace("-", " ").title() + " key" - -if ini.has_section("usign"): - usign_key = ini['usign'].get("key") - usign_comment = ini['usign'].get("comment", usign_comment) - -enable_kmod_archive = inip1.getboolean("kmod_archive", False) - # find targets targets = [ ] -- 2.30.2