1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 05:29:32 +00:00

wic: always read image partitions

Got rid of lazy evaluation of self.partitions property.
It's not needed because partitions of the source image should
be always read.

(From OE-Core rev: 1186fd8fd4a4789dc7c60feb86cc9fdd03fee7b3)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh
2017-08-25 23:12:28 +03:00
committed by Richard Purdie
parent cdef76e424
commit 7724e6fff7
+3 -2
View File
@@ -254,12 +254,13 @@ class Disk:
if not self.parted: if not self.parted:
raise WicError("Can't find executable parted") raise WicError("Can't find executable parted")
self.partitions = self.get_partitions()
def __del__(self): def __del__(self):
for path in self._partimages.values(): for path in self._partimages.values():
os.unlink(path) os.unlink(path)
@property def get_partitions(self):
def partitions(self):
if self._partitions is None: if self._partitions is None:
self._partitions = OrderedDict() self._partitions = OrderedDict()
out = exec_cmd("%s -sm %s unit B print" % (self.parted, self.imagepath)) out = exec_cmd("%s -sm %s unit B print" % (self.parted, self.imagepath))