]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: partitionedfs: merged __format_disks and create
authorEd Bartosh <ed.bartosh@linux.intel.com>
Wed, 8 Feb 2017 18:51:25 +0000 (20:51 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 16 Feb 2017 04:06:32 +0000 (20:06 -0800)
Private method __format_disks is called only from create
method making the code less readable. Merged the code
into one method.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/utils/partitionedfs.py

index 5fc5765d65837dfb77cd8264b42b5c6f51e19a3d..08ae52f3e54f01a1d93a3d9ef5de47aac9f89754 100644 (file)
@@ -238,7 +238,11 @@ class Image():
 
         return exec_native_cmd(cmd, self.native_sysroot)
 
-    def __format_disks(self):
+    def create(self):
+        for dev in self.disks:
+            disk = self.disks[dev]
+            disk['disk'].create()
+
         self.layout_partitions()
 
         for dev in self.disks:
@@ -375,12 +379,3 @@ class Image():
                 partimage = image_file + '.p%d' % part['num']
                 os.rename(source, partimage)
                 self.partimages.append(partimage)
-
-    def create(self):
-        for dev in self.disks:
-            disk = self.disks[dev]
-            disk['disk'].create()
-
-        self.__format_disks()
-
-        return