]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: always read image partitions
authorEd Bartosh <ed.bartosh@linux.intel.com>
Fri, 25 Aug 2017 20:12:28 +0000 (23:12 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 27 Aug 2017 21:29:46 +0000 (22:29 +0100)
Got rid of lazy evaluation of self.partitions property.
It's not needed because partitions of the source image should
be always read.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/engine.py

index 303f323b8384a1a17328bd8e2b18b10cb6eec145..eafc6c783ec5b44eba5f8839241dc341e92e3c12 100644 (file)
@@ -254,12 +254,13 @@ class Disk:
         if not self.parted:
             raise WicError("Can't find executable parted")
 
+        self.partitions = self.get_partitions()
+
     def __del__(self):
         for path in self._partimages.values():
             os.unlink(path)
 
-    @property
-    def partitions(self):
+    def get_partitions(self):
         if self._partitions is None:
             self._partitions = OrderedDict()
             out = exec_cmd("%s -sm %s unit B print" % (self.parted, self.imagepath))