Reorder group/server parsing and skip empty entries in config parser
All checks were successful
Build-Publish / build (linux/amd64) (push) Successful in 5s
Build-Publish / build (linux/arm64) (push) Successful in 12s
Build-Publish / create-manifest (push) Successful in 7s
Build-Publish / publish-template (push) Successful in 9s

This commit is contained in:
j
2026-03-08 21:04:39 +13:00
parent d9d7662d8c
commit d96d5be2e1

View File

@@ -60,26 +60,29 @@ def parse_infrastructure_conf():
stripped = line.strip()
if not stripped or stripped.startswith('#'):
continue
# Group header: no leading whitespace
if line[0] not in (' ', '\t'):
current_group = stripped
current_host = None
continue
# Detect prefix: -- child VM, - host
# Server entry: starts with - or -- (with optional leading whitespace)
if stripped.startswith('--'):
is_child = True
rest = stripped[2:].strip()
elif stripped.startswith('-'):
is_child = False
rest = stripped[1:].strip()
elif line[0] not in (' ', '\t') and not stripped.startswith('-'):
# Group header: no leading whitespace, no dash prefix
current_group = stripped
current_host = None
continue
else:
# Legacy: no dash prefix, treat as host
# Legacy: indented without dash, treat as host
is_child = False
rest = stripped
parts = rest.split(None, 1)
entry = parts[0] if parts else ''
url = parts[1] if len(parts) > 1 else ''
if not entry:
continue
if '@' in entry:
user, host = entry.split('@', 1)
else: