diff options
author | Armin Kuster <akuster808@gmail.com> | 2020-03-01 21:39:56 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-16 16:44:53 +0000 |
commit | f42a79c02d0285ab6cef7e1c9b5db8527ac8b0c7 (patch) | |
tree | a64e5c4289513b1197e94ac6fc49ffffc1731352 /scripts/lib | |
parent | a3187545df67933e3cd3393f51807b36a23215c7 (diff) | |
download | poky-f42a79c02d0285ab6cef7e1c9b5db8527ac8b0c7.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: 29a1d9bed5bf7ed024870a0323f9afdf88346e4d)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 15d1722950a22649905cf8a5789d3cfe48a2a892)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/wic/engine.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py index 18776fa8a0..4ccca482e7 100644 --- a/scripts/lib/wic/engine.py +++ b/scripts/lib/wic/engine.py | |||
@@ -290,7 +290,7 @@ class Disk: | |||
290 | 290 | ||
291 | def _get_part_image(self, pnum): | 291 | def _get_part_image(self, pnum): |
292 | if pnum not in self.partitions: | 292 | if pnum not in self.partitions: |
293 | raise WicError("Partition %s is not in the image") | 293 | raise WicError("Partition %s is not in the image" % pnum) |
294 | part = self.partitions[pnum] | 294 | part = self.partitions[pnum] |
295 | # check if fstype is supported | 295 | # check if fstype is supported |
296 | for fstype in self.fstypes: | 296 | for fstype in self.fstypes: |
@@ -313,6 +313,9 @@ class Disk: | |||
313 | seek=self.partitions[pnum].start) | 313 | seek=self.partitions[pnum].start) |
314 | 314 | ||
315 | def dir(self, pnum, path): | 315 | def dir(self, pnum, path): |
316 | if pnum not in self.partitions: | ||
317 | raise WicError("Partition %s is not in the image" % pnum) | ||
318 | |||
316 | if self.partitions[pnum].fstype.startswith('ext'): | 319 | if self.partitions[pnum].fstype.startswith('ext'): |
317 | return exec_cmd("{} {} -R 'ls -l {}'".format(self.debugfs, | 320 | return exec_cmd("{} {} -R 'ls -l {}'".format(self.debugfs, |
318 | self._get_part_image(pnum), | 321 | self._get_part_image(pnum), |