aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJing Lu <lvjing5@huawei.com>2016-12-21 04:28:51 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-12-21 04:28:51 +0000
commitcd34d540ce1d5da5ba5df0a2d169013b5b222418 (patch)
tree5126df6dc9c21799ece18015a2ea3b562d79e514
parentdcc1818e66580808de9e427812a1c82f7e0673ff (diff)
parent6b04f5552159c2c34486178fba34dd57b4eaca27 (diff)
Merge "fixed issue in yardstick-img-modify cleanup() fun"
-rwxr-xr-xtools/yardstick-img-modify6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/yardstick-img-modify b/tools/yardstick-img-modify
index 0033383ef..1743d908a 100755
--- a/tools/yardstick-img-modify
+++ b/tools/yardstick-img-modify
@@ -152,9 +152,13 @@ cleanup() {
mount | grep $mountdir/proc && umount $mountdir/proc
mount | grep $mountdir && umount $mountdir
mount | grep "/mnt/vivid" && umount "/mnt/vivid"
+
if [ -f $raw_imgfile ]; then
- kpartx -dv $raw_imgfile
+ if [ -z "$(kpartx -l $raw_imgfile | grep 'loop deleted')" ]; then
+ kpartx -dv $raw_imgfile
+ fi
fi
+
rm -f $raw_imgfile
rm -rf $mountdir
}