Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup old zaza models #258

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions openstack/tools/charmed_openstack_functest_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ done
# Install dependencies
which yq &>/dev/null || sudo snap install yq

# Cleanup zaza-* models before proceeding
OLD_ZAZA_MODELS=$(juju list-models| grep -E "^zaza-\S+"|tr -d '*')
if [ -n "${OLD_ZAZA_MODELS}" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a helper function to do this now - https://github.com/canonical/stsstack-bundles/blob/main/openstack/tools/func_test_tools/common.sh#L1

it is already being run before and after a test run, do we really need to do it again here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see f0a3097

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, this was not there when I wrote it yesterday, so I guess this PR can be dropped

echo "Old zaza-* models active, cleaning up."
for j in $(echo "${OLD_ZAZA_MODELS}"); do
juju destroy-model "${j}" --no-prompt --force --no-wait --destroy-storage
done
fi

# Ensure zosci-config checked out and up-to-date
(
cd
Expand Down