Skip to contentSkip to conversation

wic: Fix error message when reporting invalid offset

PATCH New Joshua Watt 1 participant 1 message Jun 12, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wic: Fix error message when reporting invalid offset

The error message was reporting the calculated offset instead of the current offset, which made it confusing.

---
 scripts/lib/wic/plugins/imager/direct.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/wic/plugins/imager/direct.py +1 -1
index 1f65a7afe5..2f01999405 100644
@@ -436,7 +436,7 @@ class PartitionedImage():
 
                 delta = offset - self.offset
                 if delta < 0:
-                    raise WicError("Could not place %s%s at offset %dK: next free sector is %d (delta: %d)" % (part.disk, self.numpart, part.offset, offset, delta))
+                    raise WicError("Could not place %s%s at offset %dK: next free sector is %d (delta: %d)" % (part.disk, self.numpart, part.offset, self.offset, delta))
 
                 logger.debug("Skipping %d sectors to place %s%s at offset %dK",
                              delta, part.disk, self.numpart, part.offset)
Signature · 1 line
2.26.2