projects
/
tools
/
mic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
752e28e
)
more accurate checking for tarball of loop images
author
Gui Chen
<gui.chen@intel.com>
Mon, 9 Jan 2012 09:38:37 +0000
(17:38 +0800)
committer
JF Ding
<jian-feng.ding@intel.com>
Mon, 9 Jan 2012 09:50:14 +0000
(17:50 +0800)
Signed-off-by: Gui Chen <gui.chen@intel.com>
plugins/imager/loop_plugin.py
patch
|
blob
|
history
diff --git
a/plugins/imager/loop_plugin.py
b/plugins/imager/loop_plugin.py
index 649152cb0202c7c0c651f6cab3bea86d3a347410..c84efe67dac7544bb2df1b748e91640aae839f9a 100644
(file)
--- a/
plugins/imager/loop_plugin.py
+++ b/
plugins/imager/loop_plugin.py
@@
-183,10
+183,13
@@
class LoopPlugin(ImagerPlugin):
@classmethod
def do_chroot(cls, target):
- import tarfile
- if tarfile.is_tarfile(target):
- LoopPlugin._do_chroot_tar(target)
- return
+ if target.endswith('.tar'):
+ import tarfile
+ if tarfile.is_tarfile(target):
+ LoopPlugin._do_chroot_tar(target)
+ return
+ else:
+ raise errors.CreatorError("damaged tarball for loop images")
img = target
imgsize = misc.get_file_size(img) * 1024L * 1024L