Skip to content

Commit

Permalink
Catch juju destroy-model error
Browse files Browse the repository at this point in the history
It is possible, especially with Juju 2.x for list-models to return
a model that is being destroyed for us to them run destroy-model by
the time it has gone which will then fail. We need to catch this
otherwise it can cause a test run to fail.
  • Loading branch information
dosaboy committed Oct 16, 2024
1 parent 539b701 commit f9a3cdb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openstack/tools/func_test_tools/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ destroy_zaza_models ()
for model in $(juju list-models| egrep -o "^zaza-\S+"|tr -d '*'); do
if $j3; then
juju destroy-model --no-prompt --force --no-wait \
--destroy-storage $model
--destroy-storage $model || true
else
juju destroy-model --yes --force --no-wait --destroy-storage \
$model
$model || true
fi
done
}
Expand Down Expand Up @@ -43,4 +43,4 @@ apply_func_test_pr ()
-f './test-requirements*.txt' \
-f './src/test-requirements*.txt' \
"$msg"
}
}

0 comments on commit f9a3cdb

Please sign in to comment.