diff options
author | Jing Lu <lvjing5@huawei.com> | 2016-12-21 04:28:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-12-21 04:28:51 +0000 |
commit | cd34d540ce1d5da5ba5df0a2d169013b5b222418 (patch) | |
tree | 5126df6dc9c21799ece18015a2ea3b562d79e514 /tools/yardstick-img-modify | |
parent | dcc1818e66580808de9e427812a1c82f7e0673ff (diff) | |
parent | 6b04f5552159c2c34486178fba34dd57b4eaca27 (diff) |
Merge "fixed issue in yardstick-img-modify cleanup() fun"
Diffstat (limited to 'tools/yardstick-img-modify')
-rwxr-xr-x | tools/yardstick-img-modify | 6 |
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 } |