summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGui Chen <gui.chen@intel.com>2012-10-24 15:34:50 +0800
committerGui Chen <gui.chen@intel.com>2012-10-25 14:10:45 +0800
commit4bf0e38d333709a491385a25a748a7dd88e74436 (patch)
tree39d96e76752d80aa3fcb4ee49a1fa1e61f008e59 /plugins
parent7d57eb40bef8035e677599e54bd64990e0e256de (diff)
downloadmic-4bf0e38d333709a491385a25a748a7dd88e74436.tar.gz
mic-4bf0e38d333709a491385a25a748a7dd88e74436.tar.bz2
mic-4bf0e38d333709a491385a25a748a7dd88e74436.zip
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 <gui.chen@intel.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/imager/fs_plugin.py2
-rw-r--r--plugins/imager/livecd_plugin.py2
-rw-r--r--plugins/imager/liveusb_plugin.py2
-rw-r--r--plugins/imager/loop_plugin.py4
-rw-r--r--plugins/imager/raw_plugin.py2
5 files changed, 6 insertions, 6 deletions
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")