partitionedfs: rename self.__create_part_to_image
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Fri, 4 Jan 2013 14:17:21 +0000 (16:17 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Fri, 11 Jan 2013 09:42:54 +0000 (11:42 +0200)
The 'self.__create_part_to_image()' is too long and not too descriptive either.
Let's name it '__create_partition()' instead.

Change-Id: I556c8dd872b1fd79d8c44fac0ca5130ae1521bc8
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
mic/utils/partitionedfs.py

index e7009f1..b36a078 100644 (file)
@@ -151,7 +151,7 @@ class PartitionedMount(Mount):
 
             self.__add_partition(part)
 
-    def __create_part_to_image(self, device, parttype, fstype, start, size):
+    def __create_partition(self, device, parttype, fstype, start, size):
         # Start is included to the size so we need to substract one from the end.
         end = start+size-1
         msger.debug("Added '%s' part at Sector %d with size %d sectors" %
@@ -288,7 +288,8 @@ class PartitionedMount(Mount):
         for p in self.partitions:
             d = self.disks[p['disk_name']]
             if p['num'] == 5:
-                self.__create_part_to_image(d['disk'].device, "extended",None,p['start'], d['extended'])
+                self.__create_partition(d['disk'].device, "extended", None,
+                                        p['start'], d['extended'])
 
             if p['fstype'] == "swap":
                 parted_fs_type = "linux-swap"
@@ -306,9 +307,8 @@ class PartitionedMount(Mount):
                 msger.debug("Substracting one sector from '%s' partition to get even number of sectors for the partition." % (p['mountpoint']))
                 p['size'] -= 1
 
-            ret = self.__create_part_to_image(d['disk'].device, p['type'],
-                                              parted_fs_type, p['start'],
-                                              p['size'])
+            ret = self.__create_partition(d['disk'].device, p['type'],
+                                          parted_fs_type, p['start'], p['size'])
 
             if ret != 0:
                 # NOTE: We don't throw exception when return code is not 0, because