[inventory] fix SC2015 for CI shellcheck 0.9
ci / audit (pull_request) Successful in 18s

Unambiguous if-form for the two-condition guard. CI (node:20-bookworm,
Debian shellcheck 0.9) flags the A && B || C pattern where the koalaman
stable docker path passed. No behavior change.

CI evidence: https://git.knownelement.com/KNEL/inventory/actions/runs/118227
Ticket: https://projects.knownelement.com/issues/784
This commit is contained in:
2026-09-06 09:25:04 -05:00
parent 5858e7cf13
commit edd755c492
2 changed files with 39 additions and 1 deletions
+3 -1
View File
@@ -81,7 +81,9 @@ while IFS=$'\t' read -r fa pa fb pb; do
[ -n "$fa" ] || continue
pa=${pa:-unknown}; pb=${pb:-unknown}
ida=$(ensure_port "$fa" "$pa"); idb=$(ensure_port "$fb" "$pb")
[ -n "$ida" ] && [ -n "$idb" ] || { echo "SKIP link $fa/$pa <-> $fb/$pb (missing CI/port)" >&2; continue; }
if [ -z "$ida" ] || [ -z "$idb" ]; then
echo "SKIP link $fa/$pa <-> $fb/$pb (missing CI/port)" >&2; continue
fi
lo=$(( ida < idb ? ida : idb )); hi=$(( ida < idb ? idb : ida ))
if api GET "search/NetworkPort_NetworkPort?criteria%5B0%5D%5Bfield%5D=13&criteria%5B0%5D%5Bsearchtype%5D=equals&criteria%5B0%5D%5Bvalue%5D=$lo" \
| grep -q "\"$hi\""; then conn_dup=$((conn_dup+1)); continue; fi