]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: direct: move creation of PartitionedImage to __init__
authorEd Bartosh <ed.bartosh@linux.intel.com>
Fri, 10 Feb 2017 14:44:03 +0000 (16:44 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 16 Feb 2017 04:06:35 +0000 (20:06 -0800)
Moved creation of PartitionedImage object from DirectPlugin.create
method to init. It makes the code a bit more readable and logical.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
scripts/lib/wic/plugins/imager/direct.py

index c517904ed119fc01f50eebdd178bc607d883075e..481d24d5ba47bad83f10cf6c00a7208f882a5da5 100644 (file)
@@ -81,6 +81,10 @@ class DirectPlugin(ImagerPlugin):
                 self.ks.bootloader.source = part.source
                 break
 
+        image_path = self._full_path(self.workdir, self.parts[0].disk, "direct")
+        self._image = PartitionedImage(image_path, self.ptable_format,
+                                       self.parts, self.native_sysroot)
+
     def do_create(self):
         """
         Plugin entry point.
@@ -150,10 +154,6 @@ class DirectPlugin(ImagerPlugin):
         filesystems from the artifacts directly and combine them into
         a partitioned image.
         """
-        image_path = self._full_path(self.workdir, self.parts[0].disk, "direct")
-        self._image = PartitionedImage(image_path, self.ptable_format,
-                                       self.parts, self.native_sysroot)
-
         fstab_path = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
 
         for part in self.parts: