uyuni-project / uyuni-tools

Tools to work with containerized Uyuni server
Apache License 2.0
16 stars 19 forks source link

Check if volume directory is mounted when purging #402

Closed aaannz closed 4 months ago

aaannz commented 4 months ago

What does this PR change?

Mounted volume cannot be removed and podman thus exits with non- zero return even though data and internal record were purged. This commit adds mount check on podman data removal and reports error only when volume dir is not empty and not mounted.

This commit also fixes error handling when volume purge was not successful.

Test coverage

Links

Issue(s): https://github.com/SUSE/spacewalk/issues/24417

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Before you merge

Check How to branch and merge properly!