summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJungseung Lee <js07.lee@samsung.com>2018-03-28 19:15:18 +0900
committerXiao Jin <jin.xiao@samsung.com>2018-04-14 01:47:33 +0800
commit8fa79e49fd7634d94dc48eb6db5e427cef199d63 (patch)
tree03e69b14bd72be116c8be770104e6b398f891762
parent93da5188a3f52482851ff944e96386e6c47787aa (diff)
downloadmic-8fa79e49fd7634d94dc48eb6db5e427cef199d63.tar.gz
mic-8fa79e49fd7634d94dc48eb6db5e427cef199d63.tar.bz2
mic-8fa79e49fd7634d94dc48eb6db5e427cef199d63.zip
Check exit status of vdfs image creation
If vdfs creation process exit with failure (EXIT_FAILURE), it should be checked. Because it could cause malformed vdfs image creation. In this patch, we added checking code of exit status. Change-Id: I5aae6a8cb6de0b4dcf2dc1f9e27ee6139b26f918 Signed-off-by: Jungseung Lee <js07.lee@samsung.com>
-rw-r--r--mic/imager/loop.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mic/imager/loop.py b/mic/imager/loop.py
index 04abd0a..dc2123d 100644
--- a/mic/imager/loop.py
+++ b/mic/imager/loop.py
@@ -20,7 +20,7 @@ import glob
import shutil
from mic import kickstart, msger
-from mic.utils.errors import CreatorError, MountError
+from mic.utils.errors import CreatorError, MountError, VdfsError
from mic.utils import misc, runner, fs_related as fs
from mic.imager.baseimager import BaseImageCreator
from mic.archive import packing, compressing
@@ -455,7 +455,10 @@ class LoopImageCreator(BaseImageCreator):
fullpathmkvdfs = "mkfs.vdfs" #find_binary_path("mkfs.vdfs")
runner.show("%s --help" % fullpathmkvdfs)
# fs.mkvdfs(mountpoint, self._outdir+"/"+item['label']+fs_suffix, vdfsopts)
- runner.show('%s %s -r %s %s' % (fullpathmkvdfs, vdfsopts, mountpoint, self._imgdir+"/"+item['label']+fs_suffix))
+ ret = runner.show('%s %s -r %s %s' % (fullpathmkvdfs, vdfsopts, mountpoint, self._imgdir+"/"+item['label']+fs_suffix))
+ if ret != 0:
+ runner.show("mkfs.vdfs return error")
+ raise VdfsError("' %s' exited with error (%d)" % (fullpathmkvdfs, ret))
runner.show('umount %s' % mountpoint)
# os.unlink(mountpoint)