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