From 3c903f14c25d87f4fb0b3a0ee7e860b6fa5b2d96 Mon Sep 17 00:00:00 2001 From: Yureka Date: Mon, 22 Jul 2024 23:59:00 +0200 Subject: [PATCH] fixup! fix(build): use per-worker slot store --- buildbot_nix/__init__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/buildbot_nix/__init__.py b/buildbot_nix/__init__.py index 2e25b5a..7435e2c 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -56,14 +56,17 @@ class NixBuilder: publicHostKey: str | None = None sshUser: str | None = None sshKey: str | None = None - systems: list[str] = field(default_factory=lambda: ["-"]) - supportedFeatures: list[str] = field(default_factory=lambda: ["-"]) - mandatoryFeatures: list[str] = field(default_factory=lambda: ["-"]) + systems: list[str] = field(default_factory=lambda: []) + supportedFeatures: list[str] = field(default_factory=lambda: []) + mandatoryFeatures: list[str] = field(default_factory=lambda: []) def to_nix_line(self): + systems = ["-"] if not self.systems else self.systems + supportedFeatures = ["-"] if not self.supportedFeatures else self.supportedFeatures + mandatoryFeatures = ["-"] if not self.mandatoryFeatures else self.mandatoryFeatures encoded_public_key = base64.b64encode(self.publicHostKey.encode('ascii')).decode('ascii') if self.publicHostKey is not None else "-" fullConnection = f"{self.protocol}://{self.sshUser}@{self.hostName}" if self.sshUser is not None else self.hostName - return f"{fullConnection} {",".join(self.systems)} {self.sshKey or "-"} {self.maxJobs} {self.speedFactor} {",".join(self.supportedFeatures)} {",".join(self.mandatoryFeatures)} {encoded_public_key}" + return f"{fullConnection} {",".join(systems)} {self.sshKey or "-"} {self.maxJobs} {self.speedFactor} {",".join(supportedFeatures)} {",".join(mandatoryFeatures)} {encoded_public_key}" @dataclass