fix mic chroot failure caused by unmatching parameters
authorGui Chen <gui.chen@intel.com>
Wed, 24 Oct 2012 07:34:50 +0000 (15:34 +0800)
committerGui Chen <gui.chen@intel.com>
Thu, 25 Oct 2012 06:10:45 +0000 (14:10 +0800)
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 <gui.chen@intel.com>
plugins/imager/fs_plugin.py
plugins/imager/livecd_plugin.py
plugins/imager/liveusb_plugin.py
plugins/imager/loop_plugin.py
plugins/imager/raw_plugin.py

index 70985b7..47df1bb 100644 (file)
@@ -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)
index 98b6dbb..26c2d11 100644 (file)
@@ -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)
 
index e0f079a..babcfa6 100644 (file)
@@ -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)
 
index 78cde65..7e3141f 100644 (file)
@@ -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):
index 2de058f..5c8be60 100644 (file)
@@ -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")