dc-node-v6-carve.py: honour MAAS_PROFILE; refuse instead of tracebacking
The script was env-blind -- default 'admin', --profile only, no environment
read anywhere. Every bash tool here honours MAAS_PROFILE, so
`export MAAS_PROFILE=vr1-dc0-region` left THIS tool silently targeting the
Office1 region. During the per-DC region migration that is the
unrecoverable direction: against the wrong region a carve is an idempotent
no-op that prints PASS while the region you meant stays untouched.

It now reads MAAS_PROFILE, keeps --profile as an override, and prints which
region it targets and where that came from -- a capture that does not name
the profile cannot be audited for wrong-region work.

An absent maas CLI raised FileNotFoundError and exited 1 with a traceback,
indistinguishable from a real failure and contrary to this script's own
REFUSE contract. It now refuses with exit 2.

Harness 14/14 (was 9); both fixes proven able to fail.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HvCyrwvYTTcDYnRErfMsNf
1 parent 93bc6dc commit 3b74bbd14eaea27d58a58bdab8ce66935f57f1ae
@JANeumatrix JANeumatrix authored 1 day ago
Showing 2 changed files
View
scripts/dc-node-v6-carve.py
View
tests/dc-node-v6-carve/run-tests.sh