restore the yardstick-img-modify cleanup() func 57/26357/2
authorRyan.RCS <lihainong@huawei.com>
Wed, 21 Dec 2016 07:44:21 +0000 (07:44 +0000)
committerRyan.RCS <lihainong@huawei.com>
Wed, 21 Dec 2016 07:59:36 +0000 (07:59 +0000)
There is a result failed again after last update.
So i restore the clean() function to its original codes and avoid CI failed.
But i'm not sure something about the clean() function,
and I will check this failed clearly in future.

Change-Id: I8f49533788c7ccb2016e7a484368a72028579fa8
JIRA: YARDSTICK-502
Signed-off-by: Ryan.RCS <lihainong@huawei.com>
tools/yardstick-img-modify

index 1743d90..68ce6e2 100755 (executable)
@@ -154,9 +154,11 @@ cleanup() {
     mount | grep "/mnt/vivid" && umount "/mnt/vivid"
 
     if [ -f $raw_imgfile ]; then
-        if [ -z "$(kpartx -l $raw_imgfile | grep 'loop deleted')" ]; then
-            kpartx -dv $raw_imgfile
-        fi
+        #kpartx -dv $raw_imgfile sometimes failed, we should checked it agein.
+        #if [ -z "$(kpartx -l $raw_imgfile | grep 'loop deleted')" ]; then
+        #    kpartx -dv $raw_imgfile
+        #fi
+        kpartx -dv $raw_imgfile || true
     fi
 
     rm -f $raw_imgfile