Bug 1933: Fix ready check 86/11786/1
authorbeierlm <mark.beierl@canonical.com>
Fri, 25 Mar 2022 16:23:36 +0000 (12:23 -0400)
committerbeierlm <mark.beierl@canonical.com>
Fri, 25 Mar 2022 16:23:36 +0000 (12:23 -0400)
Changes to juju result in human readable output no longer
being applicable for the deployment completion check.
Changes to use json output instead.

Fixes Bug 1933

Change-Id: I65358c7f472956ed4238a5a61cceb1651d88feff
Signed-off-by: beierlm <mark.beierl@canonical.com>
installers/charmed_install.sh
installers/charmed_uninstall.sh

index e6b8ffe..bdf043e 100755 (executable)
@@ -299,7 +299,7 @@ function check_osm_deployed() {
     previous_count=0
     while true
     do
-        service_count=$(juju status -m $MODEL_NAME | grep kubernetes | grep active | wc -l)
+        service_count=$(juju status --format json -m $MODEL_NAME | jq '.applications[]."application-status".current' | grep active | wc -l)
         echo "$service_count / $total_service_count services active"
         if [ $service_count -eq $total_service_count ]; then
             break
index 09305d2..20ca7b6 100755 (executable)
@@ -14,7 +14,7 @@
 #
 
 
-juju destroy-model osm --destroy-storage -y --force --no-wait
+juju destroy-model osm --destroy-storage -y --force
 sudo snap unalias osm
 sudo snap remove osmclient
 CONTROLLER_NAME="osm-vca"