Only hardlink files from cache_dir if it exists

When setup_workspace is being run on a system without a cached dir it
will fail when find is ran on the non-existent dir. This can happen when
running running reproduce.sh from a gate job on a blank vm.

Change-Id: I69795848cd0b95f7d377af7463042562a84e2b8a
This commit is contained in:
Matthew Treinish 2017-04-25 11:32:11 -04:00
parent a0cf5e926c
commit 903f1a6bc6
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
1 changed files with 4 additions and 2 deletions

View File

@ -517,8 +517,10 @@ function setup_workspace {
rm -rf ~/cache/files/
fi
# copy them to where devstack expects with hardlinks to save space
find $cache_dir -mindepth 1 -maxdepth 1 -exec cp -l {} $DEST/devstack/files/ \;
if [ -d $cache_dir ]; then
# copy them to where devstack expects with hardlinks to save space
find $cache_dir -mindepth 1 -maxdepth 1 -exec cp -l {} $DEST/devstack/files/ \;
fi
# Disable detailed logging as we return to the main script
$xtrace