clan-cli: Fix get_all_facts forgetting to generate facts before getting them

This commit is contained in:
Qubasa
2025-03-02 15:07:57 +01:00
parent e7aa5cfb4e
commit ba28691747
2 changed files with 3 additions and 9 deletions

View File

@@ -255,7 +255,7 @@ class AsyncRuntime:
This is useful to keep track of the origin of the task. This is useful to keep track of the origin of the task.
""" """
future = self.async_run(opts, function, *args, **kwargs) future = self.async_run(opts, function, *args, **kwargs)
return AsyncFutureRef(future._tid, self, ref) # noqa: SLF001 return AsyncFutureRef(_tid=future._tid, _runtime=self, ref=ref) # noqa: SLF001
def join_all(self) -> None: def join_all(self) -> None:
""" """

View File

@@ -5,6 +5,7 @@ import logging
from typing import Any from typing import Any
from clan_cli.completions import add_dynamic_completer, complete_machines from clan_cli.completions import add_dynamic_completer, complete_machines
from clan_cli.facts.generate import generate_facts
from clan_cli.machines.machines import Machine from clan_cli.machines.machines import Machine
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@@ -13,15 +14,8 @@ log = logging.getLogger(__name__)
# TODO get also secret facts # TODO get also secret facts
def get_all_facts(machine: Machine) -> dict: def get_all_facts(machine: Machine) -> dict:
public_facts_store = get_public_facts_store(machine) public_facts_store = get_public_facts_store(machine)
generate_facts([machine], public_facts_store)
# for service in machine.secrets_data:
# facts[service] = {}
# for fact in machine.secrets_data[service]["facts"]:
# fact_content = fact_store.get(service, fact)
# if fact_content:
# facts[service][fact] = fact_content.decode()
# else:
# log.error(f"Fact {fact} for service {service} is missing")
return public_facts_store.get_all() return public_facts_store.get_all()