summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2020-03-01 21:39:56 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-02 21:00:54 +0000
commit26525f2f4f290d2ac5430c70c8a137aa0a0d6f32 (patch)
tree3453e5ba0a3714158672315f8d26e692e5b0235d /scripts
parent91651872758151a2dd8f5cc3c52b310d0a62232d (diff)
downloadpoky-26525f2f4f290d2ac5430c70c8a137aa0a0d6f32.tar.gz
wic/engine: lets display an error not a traceback
If the requested partition does not exist in this request "wic ls {path}:pnum" display a nice message not a trackback Also fix displaying the pnum and not "%s" (From OE-Core rev: 15d1722950a22649905cf8a5789d3cfe48a2a892) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/engine.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index 83c42c9987..9ff4394757 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -291,7 +291,7 @@ class Disk:
291 291
292 def _get_part_image(self, pnum): 292 def _get_part_image(self, pnum):
293 if pnum not in self.partitions: 293 if pnum not in self.partitions:
294 raise WicError("Partition %s is not in the image") 294 raise WicError("Partition %s is not in the image" % pnum)
295 part = self.partitions[pnum] 295 part = self.partitions[pnum]
296 # check if fstype is supported 296 # check if fstype is supported
297 for fstype in self.fstypes: 297 for fstype in self.fstypes:
@@ -314,6 +314,9 @@ class Disk:
314 seek=self.partitions[pnum].start) 314 seek=self.partitions[pnum].start)
315 315
316 def dir(self, pnum, path): 316 def dir(self, pnum, path):
317 if pnum not in self.partitions:
318 raise WicError("Partition %s is not in the image" % pnum)
319
317 if self.partitions[pnum].fstype.startswith('ext'): 320 if self.partitions[pnum].fstype.startswith('ext'):
318 return exec_cmd("{} {} -R 'ls -l {}'".format(self.debugfs, 321 return exec_cmd("{} {} -R 'ls -l {}'".format(self.debugfs,
319 self._get_part_image(pnum), 322 self._get_part_image(pnum),