summaryrefslogtreecommitdiffstats
path: root/tools/daisy-img-modify.sh
diff options
context:
space:
mode:
authorAlex Yang <yangyang1@zte.com.cn>2018-08-20 17:05:29 +0800
committerAlex Yang <yangyang1@zte.com.cn>2018-08-20 17:05:29 +0800
commit28e00b07abf318b17cb681cdac862437c54ed7c8 (patch)
treea3e4678d76e6af033b430b480125480ffbadf299 /tools/daisy-img-modify.sh
parent0670fed39189911eaf3372574bb0ecb56e2ce67a (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>
Diffstat (limited to 'tools/daisy-img-modify.sh')
-rwxr-xr-xtools/daisy-img-modify.sh5
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