Skip to content

Commit 2231c31

Browse files
fix: implement semantic string-to-bool normalization in cli.py (#1466) (#1623)
1 parent b68259f commit 2231c31

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • skills/azure-architecture-autopilot/scripts

skills/azure-architecture-autopilot/scripts/cli.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,15 @@ def _normalize_services(services):
137137
if isinstance(svc.get("details"), str):
138138
svc["details"] = [svc["details"]]
139139
if isinstance(svc.get("private"), str):
140-
svc["private"] = bool(svc["private"])
140+
val = svc["private"].lower()
141+
if val in ("true", "1", "yes", "on"):
142+
svc["private"] = True
143+
elif val in ("false", "0", "no", "off"):
144+
svc["private"] = False
145+
else:
146+
# Log warning for invalid values
147+
print(f"WARNING: Invalid boolean value '{svc['private']}' for 'private' field. Defaulting to False.", file=sys.stderr)
148+
svc["private"] = False
141149
return services
142150

143151

0 commit comments

Comments
 (0)