switch: fix the unquoted python string that broke status with no --name
`cmd_status` has two paths. The `--name` path filters on an exact tag and works. The no-name path — the "show me every switch on this box" survey, which is how an orphan switch under a different name would be found — built its python with shell quote-juggling and never closed the string literal, so it died with a SyntaxError every time. It failed loudly (rc=1, a traceback) rather than reporting "no rules", so it never lied about the state. But it also meant the survey path had never once run, which is the more useful lesson: every branch of a safety tool needs exercising, not just the branch the happy path takes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -129,7 +129,7 @@ print(json.dumps([r for r in json.load(sys.stdin) if r["comment"] in tags]))
|
||||
all="$(rules_json | python3 -c '
|
||||
import json,sys
|
||||
print(json.dumps([r for r in json.load(sys.stdin)
|
||||
if (r["comment"] or "").startswith("'"$TAG_PREFIX"':')]))')"
|
||||
if (r["comment"] or "").startswith("'"$TAG_PREFIX"':")]))')"
|
||||
fi
|
||||
|
||||
python3 - "$all" "$tag" <<'PY'
|
||||
|
||||
Reference in New Issue
Block a user