testing: Ignore hosts that are not running during shutdown

This allows properly terminating the environment if a host has crashed
or was terminated manually for some reason.
This commit is contained in:
Tobias Brunner 2020-10-06 15:31:14 +02:00
parent a689e358e5
commit 8f2b6d7094
1 changed files with 6 additions and 1 deletions

View File

@ -24,7 +24,12 @@ done
for host in $STRONGSWANHOSTS
do
log_action "Guest $host"
execute "virsh shutdown $host"
if running_any $host; then
execute "virsh shutdown $host"
else
echo_warn "...not running"
fi
rm -f $VIRTIMGSTORE/$host.$IMGEXT
done