From 8f209fe526f203c3ea7e7491f487e633772c76d9 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Tue, 12 Aug 2025 10:11:25 +0200 Subject: [PATCH] Restore metal3-dev-env only if it exists If the metal3-dev-env dir does not exist for some reason (it was removed before, or changed location before the cleanup), the clenaup will fail. Restore it only if the dir exists. --- ocp_cleanup.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ocp_cleanup.sh b/ocp_cleanup.sh index a7498858f..7637d1cbe 100755 --- a/ocp_cleanup.sh +++ b/ocp_cleanup.sh @@ -74,5 +74,8 @@ fi sudo sed -ie '/^allow /d' /etc/chrony.conf # Restore file after workaround -cd ${METAL3_DEV_ENV_PATH} -git checkout vm-setup/roles/packages_installation/tasks/centos_required_packages.yml +if [ -d ${METAL3_DEV_ENV_PATH} ]; then + cd ${METAL3_DEV_ENV_PATH} + git checkout vm-setup/roles/packages_installation/tasks/centos_required_packages.yml +fi +