From 8144a1fac09d2c125cf3c6423d91e9d7e181a66e Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 10 Feb 2023 04:22:59 +0100 Subject: [PATCH] Actually ... ci-apps is still using lxd 4.10 which has empty status when the LXC is stopped --- lib/lxc.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/lxc.sh b/lib/lxc.sh index c9321d3..87cbc4f 100644 --- a/lib/lxc.sh +++ b/lib/lxc.sh @@ -140,14 +140,10 @@ LXC_STOP () { while [[ ${retry_stop_lxc} -lt 5 ]] do local status="$(lxc list $container_to_stop --format json | jq -r '.[].state.status')" - if [[ -z "$status" ]] || [[ "$status" == "Stopped" ]] + if [[ -z "$status" ]] || [[ "$status" == "Stopped" ]] || [[ "$status" == "null" ]] then break fi - if [[ ${retry_stop_lxc} -ge 3 ]] - then - log_warning "Failed to stop LXC (status=$status) ? Retrying in 10 sec ..." - fi retry_stop_lxc="$(($retry_stop_lxc+1))" sleep 10 timeout 30 lxc stop --timeout 15 $container_to_stop 2>/dev/null