summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGui Chen <gui.chen@intel.com>2011-12-27 15:07:02 +0800
committerGui Chen <gui.chen@intel.com>2011-12-27 15:07:02 +0800
commit6475a58f9cd1636ebf349cadfcf131a5a8852191 (patch)
treeb32c55e93b176cc4787ef7e83169f9d95f1130e1 /tools
parent7f074e1ccd96bc3ac188ea3fa6be732178cbea9e (diff)
downloadmic-6475a58f9cd1636ebf349cadfcf131a5a8852191.tar.gz
mic-6475a58f9cd1636ebf349cadfcf131a5a8852191.tar.bz2
mic-6475a58f9cd1636ebf349cadfcf131a5a8852191.zip
fix convert and chroot issue caused by not existed image
Signed-off-by: Gui Chen <gui.chen@intel.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/mic5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/mic b/tools/mic
index a331a32..dffb8a6 100755
--- a/tools/mic
+++ b/tools/mic
@@ -101,6 +101,8 @@ class MicCmd(cmdln.Cmdln):
else:
raise errors.Usage("Extra argument given")
+ if not os.path.exists(srcimg):
+ raise errors.CreatorError("Failed to find the image: %s" % srcimg)
self._root_confirm()
srcformat = misc.get_image_type(srcimg)
@@ -143,6 +145,9 @@ class MicCmd(cmdln.Cmdln):
else:
raise errors.Usage("Extra argument given")
+ if not os.path.exists(targetimage):
+ raise errors.CreatorError("Failed to find the image: %s"
+ % targetimage)
self._root_confirm()
imagetype = misc.get_image_type(targetimage)