diff options
author | Alex Yang <yangyang1@zte.com.cn> | 2018-08-20 17:05:29 +0800 |
---|---|---|
committer | Alex Yang <yangyang1@zte.com.cn> | 2018-08-20 17:05:29 +0800 |
commit | 28e00b07abf318b17cb681cdac862437c54ed7c8 (patch) | |
tree | a3e4678d76e6af033b430b480125480ffbadf299 | |
parent | 0670fed39189911eaf3372574bb0ecb56e2ce67a (diff) |
Change the owner of created image dir
The directory created by SUDO cannot be cleaned by jenkins.
https://build.opnfv.org/ci/job/daisy-kolla-build-master/31/
Change-Id: I02f11d72a80e173f7fef9d3b875f95c2d7b4f626
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
-rwxr-xr-x | tools/daisy-img-modify.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/daisy-img-modify.sh b/tools/daisy-img-modify.sh index 8b3a21f3..ff1ff437 100755 --- a/tools/daisy-img-modify.sh +++ b/tools/daisy-img-modify.sh @@ -99,7 +99,10 @@ raw_imgfile="${workdir}/centos7.raw" # download and checksum base image, conditionally if local copy is outdated download() { - test -d $workdir || mkdir -p $workdir + test -d $workdir || { + mkdir -p $workdir + test -z $SUDO_USER || chown -R $SUDO_USER:$SUDO_USER $workdir + } cd $workdir rm -f sha256sum.txt wget $sha256sum_url |