fix: implement semantic string-to-bool normalization in cli.py (#1466) (#1623)

This commit is contained in:
Neha Mandge
2026-05-06 05:21:18 +05:30
committed by GitHub
parent b68259f27d
commit 2231c315d0
@@ -137,7 +137,15 @@ def _normalize_services(services):
if isinstance(svc.get("details"), str):
svc["details"] = [svc["details"]]
if isinstance(svc.get("private"), str):
svc["private"] = bool(svc["private"])
val = svc["private"].lower()
if val in ("true", "1", "yes", "on"):
svc["private"] = True
elif val in ("false", "0", "no", "off"):
svc["private"] = False
else:
# Log warning for invalid values
print(f"WARNING: Invalid boolean value '{svc['private']}' for 'private' field. Defaulting to False.", file=sys.stderr)
svc["private"] = False
return services