Merge pull request 'clan-cli: Fix get_all_facts forgetting to generate facts before getting them' (#2949) from Qubasa/clan-core:other_fixes into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/2949
This commit is contained in:
@@ -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:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user