Expose nmap_os in INI loader and update test-full.ini

- ini_loader.py: DeckySpec gains nmap_os field; load_ini parses nmap_os=
  (also accepts nmap-os= hyphen alias) and propagates it to amount-expanded deckies
- cli.py: _build_deckies_from_ini resolves nmap_os with priority:
  explicit INI key > archetype default > "linux"
- test-full.ini: every decky now carries nmap_os=; [windows-workstation]
  gains archetype= so its OS family is set correctly; decky-winbox/fileserv/
  ldapdc → windows, decky-iot → embedded, decky-legacy → bsd, rest → linux
- tests/test_ini_loader.py: 7 new tests covering nmap_os parsing, defaults,
  hyphen alias, and amount= expansion propagation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 13:23:45 -03:00
parent 6610856749
commit 086643ef5a
4 changed files with 258 additions and 2 deletions

View File

@@ -179,6 +179,8 @@ def _build_deckies_from_ini(
)
raise typer.Exit(1)
# nmap_os priority: explicit INI key > archetype default > "linux"
resolved_nmap_os = spec.nmap_os or (arch.nmap_os if arch else "linux")
deckies.append(DeckyConfig(
name=spec.name,
ip=ip,
@@ -189,7 +191,7 @@ def _build_deckies_from_ini(
hostname=hostname,
archetype=arch.slug if arch else None,
service_config=spec.service_config,
nmap_os=arch.nmap_os if arch else "linux",
nmap_os=resolved_nmap_os,
))
return deckies