fix(ci): skip removed stale Molecule state

- Avoid rereading state files after removing a stale scenario directory.\n- Extend cleanup fixture coverage to multiple stale machine states.
This commit is contained in:
Timothy Stewart
2026-07-31 11:03:44 -05:00
committed by Techno Tim
parent 87ea8160c1
commit bb3843dbb1
2 changed files with 7 additions and 0 deletions
@@ -156,6 +156,10 @@ virtualbox_root_real="$(resolve_existing_dir "$virtualbox_root" || true)"
declare -a vm_records=()
for state_file in "${state_files[@]}"; do
if [[ ! -f "$state_file" ]]; then
printf 'Skipping Vagrant state removed with its stale scenario directory: %s\n' "$state_file"
continue
fi
state_file_real="$(readlink -f -- "$state_file")"
state_dir="${state_file_real%/.vagrant/machines/*/virtualbox/id}"
machine_dir="${state_file_real%/virtualbox/id}"