fix(clan/machines): move machineClass attribute selector and add a unit test for class detection

This commit is contained in:
Johannes Kirschbauer
2025-04-09 18:29:43 +02:00
parent cd11835ec4
commit 872aa8e5b6
2 changed files with 49 additions and 1 deletions

View File

@@ -62,7 +62,7 @@ class Machine:
def _class_(self) -> str:
try:
return self.flake.select(
f"clanInternals.inventory.machineClass.{self.name}"
f"clanInternals.inventory.machines.{self.name}.machineClass"
)
except ClanCmdError as e:
if re.search(f"error: attribute '{self.name}' missing", e.cmd.stderr):