Skip to content

Commit f012653

Browse files
authored
Restore metal3-dev-env only if it exists (#1784)
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.
1 parent 808f79d commit f012653

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ocp_cleanup.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,8 @@ fi
7474
sudo sed -ie '/^allow /d' /etc/chrony.conf
7575

7676
# Restore file after workaround
77-
cd ${METAL3_DEV_ENV_PATH}
78-
git checkout vm-setup/roles/packages_installation/tasks/centos_required_packages.yml
77+
if [ -d ${METAL3_DEV_ENV_PATH} ]; then
78+
cd ${METAL3_DEV_ENV_PATH}
79+
git checkout vm-setup/roles/packages_installation/tasks/centos_required_packages.yml
80+
fi
81+

0 commit comments

Comments
 (0)