refactor: remove Machine.vars_generators() method

Replace all calls to machine.vars_generators() with direct calls to
Generator.generators_from_flake() to make the dependency more explicit
and remove unnecessary indirection.

This reduces coupling to the Machine class, making the codebase more
modular and easier to refactor in the future.
This commit is contained in:
DavHau
2025-07-05 15:26:31 +07:00
parent 324e934204
commit 448e60f866
9 changed files with 81 additions and 23 deletions

View File

@@ -21,7 +21,7 @@ from clan_lib.ssh.remote import Remote
log = logging.getLogger(__name__)
if TYPE_CHECKING:
from clan_cli.vars.generate import Generator
pass
@dataclass(frozen=True)
@@ -118,11 +118,6 @@ class Machine:
return services
return {}
def vars_generators(self) -> list["Generator"]:
from clan_cli.vars.generate import Generator
return Generator.generators_from_flake(self.name, self.flake, self)
@property
def secrets_upload_directory(self) -> str:
return self.select("config.clan.core.facts.secretUploadDirectory")