diff --git a/scripts/dc-node-carve.sh b/scripts/dc-node-carve.sh index 0f65f19..e6a4246 100755 --- a/scripts/dc-node-carve.sh +++ b/scripts/dc-node-carve.sh @@ -264,10 +264,15 @@ if [ "$got" = "static:$ip" ]; then ok "$nic -> STATIC $ip on $cidr (read back '$got')"; MUTATED=$((MUTATED+1)); return 0 else bad "$nic: link read back as '$got', wanted 'static:$ip'"; return 1; fi } -# do_unlink +# do_unlink +# The REASON is a parameter, not a constant: this is called for two different +# reasons (moving a member's L3 onto br-ex, and converting a commissioning auto +# link to STATIC) and a hardcoded one made the plan for the metal-admin leg read +# "L3 moves to br-ex", which is false. A mutation log that states the wrong +# reason is the confident-but-wrong evidence class this repo keeps paying for. do_unlink(){ - local sid="$1" ifid="$2" lid="$3" nic="$4" - if [ "$COMMIT" != 1 ]; then echo " [plan] unlink $nic(id=$ifid) link id=$lid (L3 moves to br-ex)"; return 0; fi + local sid="$1" ifid="$2" lid="$3" nic="$4" why="${5:-}" + if [ "$COMMIT" != 1 ]; then echo " [plan] unlink $nic(id=$ifid) link id=$lid ($why)"; return 0; fi m interface unlink-subnet "$sid" "$ifid" id="$lid" >/dev/null 2>&1 || { bad "$nic: unlink link id=$lid failed"; return 1; } reload_ifaces "$sid"; ok "$nic: unlinked id=$lid (now $(if_l3_count "$nic") L3 link(s))"; MUTATED=$((MUTATED+1)) } @@ -295,7 +300,7 @@ lid="$(if_link_id "$nic" "$cidr")" if [ -n "$lid" ]; then note "$nic holds a commissioning '${link%%:*}' link on $cidr -- converting to STATIC $ip" - do_unlink "$sid" "$ifid" "$lid" "$nic" || return 1 + do_unlink "$sid" "$ifid" "$lid" "$nic" "converting the commissioning ${link%%:*} link to STATIC" || return 1 ifid="$(if_field "$nic" id)" fi ;; @@ -338,7 +343,7 @@ for l in (i.get("links") or []): if l.get("subnet"): print(l.get("id")) ' "$nic" 2>/dev/null); do - do_unlink "$sid" "$ifid" "$lid" "$nic" || return 1 + do_unlink "$sid" "$ifid" "$lid" "$nic" "L3 moves to br-ex" || return 1 done # 2) create the OVS bridge, moving the parent onto the provider VLAN FIRST.