diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-02-08 20:51:26 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-02-15 20:06:44 -0800 |
| commit | 86e190a6149bf364d278f01e7609c533465a17b6 (patch) | |
| tree | 6d33c970f7ee4337a90c39f0129e21b9c2e5f096 /scripts/lib/wic/utils/partitionedfs.py | |
| parent | b8354df7898471d821b85111374671f9e577a086 (diff) | |
| download | poky-86e190a6149bf364d278f01e7609c533465a17b6.tar.gz | |
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.
(From OE-Core rev: b7fb20fffada61211dda6d41f99407618428f23c)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/utils/partitionedfs.py')
| -rw-r--r-- | scripts/lib/wic/utils/partitionedfs.py | 14 |
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(): | |||
| 80 | self.disks[disk_name]['disk'] = disk_obj | 80 | self.disks[disk_name]['disk'] = disk_obj |
| 81 | self.disks[disk_name]['identifier'] = identifier | 81 | self.disks[disk_name]['identifier'] = identifier |
| 82 | 82 | ||
| 83 | def __add_partition(self, part): | ||
| 84 | """ This is a helper function for 'add_partition()' which adds a | ||
| 85 | partition to the internal list of partitions. """ | ||
| 86 | |||
| 87 | assert not self._partitions_layed_out | ||
| 88 | |||
| 89 | self.partitions.append(part) | ||
| 90 | self.__add_disk(part['disk_name']) | ||
| 91 | |||
| 92 | def add_partition(self, size, disk_name, mountpoint, source_file=None, fstype=None, | 83 | def add_partition(self, size, disk_name, mountpoint, source_file=None, fstype=None, |
| 93 | label=None, fsopts=None, boot=False, align=None, no_table=False, | 84 | label=None, fsopts=None, boot=False, align=None, no_table=False, |
| 94 | part_type=None, uuid=None, system_id=None): | 85 | part_type=None, uuid=None, system_id=None): |
| @@ -117,7 +108,10 @@ class Image(): | |||
| 117 | 'uuid': uuid, # Partition UUID | 108 | 'uuid': uuid, # Partition UUID |
| 118 | 'system_id': system_id} # Partition system id | 109 | 'system_id': system_id} # Partition system id |
| 119 | 110 | ||
| 120 | self.__add_partition(part) | 111 | assert not self._partitions_layed_out |
| 112 | |||
| 113 | self.partitions.append(part) | ||
| 114 | self._add_disk(part['disk_name']) | ||
| 121 | 115 | ||
| 122 | def layout_partitions(self, ptable_format="msdos"): | 116 | def layout_partitions(self, ptable_format="msdos"): |
| 123 | """ Layout the partitions, meaning calculate the position of every | 117 | """ Layout the partitions, meaning calculate the position of every |
