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 3934ca6908
commit 3d2ede9f8e
9 changed files with 81 additions and 23 deletions

View File

@@ -32,7 +32,9 @@ def vars_status(machine: Machine, generator_name: None | str = None) -> VarStatu
# signals if a var needs to be updated (eg. needs re-encryption due to new users added)
unfixed_secret_vars = []
invalid_generators = []
generators = machine.vars_generators()
from clan_cli.vars.generate import Generator
generators = Generator.generators_from_flake(machine.name, machine.flake, machine)
if generator_name:
for generator in generators:
if generator_name == generator.name: