Merge pull request 'Refactor(clanInternals): remove depending on clanInternals.inventory' (#3928) from hsjobeki/no-more-inventory into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3928
This commit is contained in:
hsjobeki
2025-06-10 16:00:50 +00:00
2 changed files with 3 additions and 3 deletions

View File

@@ -358,9 +358,9 @@ def test_caching_works(flake: ClanFlake) -> None:
my_flake, "get_from_nix", wraps=my_flake.get_from_nix
) as tracked_build:
assert tracked_build.call_count == 0
my_flake.select("clanInternals.inventory.meta")
my_flake.select("clanInternals.inventoryClass.inventory.meta")
assert tracked_build.call_count == 1
my_flake.select("clanInternals.inventory.meta")
my_flake.select("clanInternals.inventoryClass.inventory.meta")
assert tracked_build.call_count == 1

View File

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