forked from tim/k3s-ansible
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:
committed by
Techno Tim
parent
87ea8160c1
commit
bb3843dbb1
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user