cmds.secrets.CompileTemplates: Log missing secrets

Log the number of secrets missing to fully compile all templates.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-08 11:02:35 +01:00
commit 281e6e2440

View file

@ -253,6 +253,7 @@ class Cmd(Base): # export
os.unlink(path) os.unlink(path)
async def _compile_template_files(self, packages: Iterable[str], default_attrs: Attrs) -> list[str]: async def _compile_template_files(self, packages: Iterable[str], default_attrs: Attrs) -> list[str]:
missing = 0
if default_attrs is None: if default_attrs is None:
default_attrs = Attrs() default_attrs = Attrs()
for target in await self._list_compilation_targets(packages): for target in await self._list_compilation_targets(packages):
@ -267,6 +268,9 @@ class Cmd(Base): # export
break break
else: else:
log(WARNING, f'No secret found for target {target}, not compiling') log(WARNING, f'No secret found for target {target}, not compiling')
missing += 1
if missing > 0:
log(WARNING, f'{missing} missing secrets found. You might want to add them and run sudo {app.cmdline} again')
def __init__(self, parent: CmdDistro, name: str, help: str) -> None: def __init__(self, parent: CmdDistro, name: str, help: str) -> None:
super().__init__(parent, name, help) super().__init__(parent, name, help)