summaryrefslogtreecommitdiff
path: root/scripts/lib/wic
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-02-08 20:51:26 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-15 20:06:32 -0800
commitb7fb20fffada61211dda6d41f99407618428f23c (patch)
treea8aa987e177566d1995e12e688d2cffb1ab89d35 /scripts/lib/wic
parentb76b1bd404487df38fd99bc0d0e6a59acb10c9d3 (diff)
downloadopenembedded-core-b7fb20fffada61211dda6d41f99407618428f23c.tar.gz
openembedded-core-b7fb20fffada61211dda6d41f99407618428f23c.tar.bz2
openembedded-core-b7fb20fffada61211dda6d41f99407618428f23c.zip
wic: partitionedfs: get rid of __add_partition
3 lines long private method __add_partition is called only from add_partition method. Merged them together to increase readability. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/lib/wic')
-rw-r--r--scripts/lib/wic/utils/partitionedfs.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py
index 08ae52f3e5..2cfdf70cde 100644
--- a/scripts/lib/wic/utils/partitionedfs.py
+++ b/scripts/lib/wic/utils/partitionedfs.py
@@ -80,15 +80,6 @@ class Image():
self.disks[disk_name]['disk'] = disk_obj
self.disks[disk_name]['identifier'] = identifier
- def __add_partition(self, part):
- """ This is a helper function for 'add_partition()' which adds a
- partition to the internal list of partitions. """
-
- assert not self._partitions_layed_out
-
- self.partitions.append(part)
- self.__add_disk(part['disk_name'])
-
def add_partition(self, size, disk_name, mountpoint, source_file=None, fstype=None,
label=None, fsopts=None, boot=False, align=None, no_table=False,
part_type=None, uuid=None, system_id=None):
@@ -117,7 +108,10 @@ class Image():
'uuid': uuid, # Partition UUID
'system_id': system_id} # Partition system id
- self.__add_partition(part)
+ assert not self._partitions_layed_out
+
+ self.partitions.append(part)
+ self._add_disk(part['disk_name'])
def layout_partitions(self, ptable_format="msdos"):
""" Layout the partitions, meaning calculate the position of every