From 4bf0e38d333709a491385a25a748a7dd88e74436 Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Wed, 24 Oct 2012 15:34:50 +0800 Subject: fix mic chroot failure caused by unmatching parameters in do_chroot, cmd should have default value, otherwise the caller in former code will be failed Change-Id: Iaeb605f744083e23d9745dde4338137033e4c1b3 Signed-off-by: Gui Chen --- plugins/imager/fs_plugin.py | 2 +- plugins/imager/livecd_plugin.py | 2 +- plugins/imager/liveusb_plugin.py | 2 +- plugins/imager/loop_plugin.py | 4 ++-- plugins/imager/raw_plugin.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/imager/fs_plugin.py b/plugins/imager/fs_plugin.py index 70985b7..47df1bb 100644 --- a/plugins/imager/fs_plugin.py +++ b/plugins/imager/fs_plugin.py @@ -126,7 +126,7 @@ class FsPlugin(ImagerPlugin): return 0 @classmethod - def do_chroot(self, target, cmd):#chroot.py parse opts&args + def do_chroot(self, target, cmd=[]):#chroot.py parse opts&args try: if len(cmd) != 0: cmdline = ' '.join(cmd) diff --git a/plugins/imager/livecd_plugin.py b/plugins/imager/livecd_plugin.py index 98b6dbb..26c2d11 100644 --- a/plugins/imager/livecd_plugin.py +++ b/plugins/imager/livecd_plugin.py @@ -118,7 +118,7 @@ class LiveCDPlugin(ImagerPlugin): return 0 @classmethod - def do_chroot(cls, target, cmd): + def do_chroot(cls, target, cmd=[]): os_image = cls.do_unpack(target) os_image_dir = os.path.dirname(os_image) diff --git a/plugins/imager/liveusb_plugin.py b/plugins/imager/liveusb_plugin.py index e0f079a..babcfa6 100644 --- a/plugins/imager/liveusb_plugin.py +++ b/plugins/imager/liveusb_plugin.py @@ -119,7 +119,7 @@ class LiveUSBPlugin(ImagerPlugin): return 0 @classmethod - def do_chroot(cls, target, cmd): + def do_chroot(cls, target, cmd=[]): os_image = cls.do_unpack(target) os_image_dir = os.path.dirname(os_image) diff --git a/plugins/imager/loop_plugin.py b/plugins/imager/loop_plugin.py index 78cde65..7e3141f 100644 --- a/plugins/imager/loop_plugin.py +++ b/plugins/imager/loop_plugin.py @@ -131,7 +131,7 @@ class LoopPlugin(ImagerPlugin): return 0 @classmethod - def _do_chroot_tar(cls, target, cmd): + def _do_chroot_tar(cls, target, cmd=[]): mountfp_xml = os.path.splitext(target)[0] + '.xml' if not os.path.exists(mountfp_xml): raise errors.CreatorError("No mount point file found for this tar " @@ -192,7 +192,7 @@ class LoopPlugin(ImagerPlugin): shutil.rmtree(tmpdir, ignore_errors=True) @classmethod - def do_chroot(cls, target, cmd): + def do_chroot(cls, target, cmd=[]): if target.endswith('.tar'): import tarfile if tarfile.is_tarfile(target): diff --git a/plugins/imager/raw_plugin.py b/plugins/imager/raw_plugin.py index 2de058f..5c8be60 100644 --- a/plugins/imager/raw_plugin.py +++ b/plugins/imager/raw_plugin.py @@ -129,7 +129,7 @@ class RawPlugin(ImagerPlugin): return 0 @classmethod - def do_chroot(cls, target, cmd): + def do_chroot(cls, target, cmd=[]): img = target imgsize = misc.get_file_size(img) * 1024L * 1024L partedcmd = fs_related.find_binary_path("parted") -- cgit v1.2.3