From 2a565a8d5a795a677fae8b06628f220eb4a16b87 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Thu, 9 Nov 2023 17:18:03 +1000 Subject: [PATCH] pad worker numbering --- buildbot_nix/__init__.py | 2 +- buildbot_nix/worker.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildbot_nix/__init__.py b/buildbot_nix/__init__.py index 3d706f6..4dc338a 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -734,7 +734,7 @@ class NixConfigurator(ConfiguratorBase): for item in worker_config: cores = item.get("cores", 0) for i in range(cores): - worker_name = f"{item['name']}-{i}" + worker_name = f"{item['name']}-{i:03}" config["workers"].append(worker.Worker(worker_name, item["pass"])) worker_names.append(worker_name) diff --git a/buildbot_nix/worker.py b/buildbot_nix/worker.py index 7e1181e..65d0f8b 100644 --- a/buildbot_nix/worker.py +++ b/buildbot_nix/worker.py @@ -29,11 +29,11 @@ class WorkerConfig: def setup_worker( application: service.Application, id: int, config: WorkerConfig ) -> None: - basedir = f"{config.buildbot_dir}-{id}" + basedir = f"{config.buildbot_dir}-{id:03}" os.makedirs(basedir, mode=0o700, exist_ok=True) hostname = socket.gethostname() - workername = f"{hostname}-{id}" + workername = f"{hostname}-{id:03}" keepalive = 600 umask = None maxdelay = 300