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 20:57:24 +0000
commit15d1722950a22649905cf8a5789d3cfe48a2a892 (patch)
tree7e528ed90ff935534658626652951ef28d06aec8 /scripts
parent713837a0a2d51b3a9aaf3d5aa053f9503f9c362d (diff)
downloadopenembedded-core-contrib-15d1722950a22649905cf8a5789d3cfe48a2a892.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" 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 83c42c99879..9ff43947575 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -291,7 +291,7 @@ class Disk:
def _get_part_image(self, pnum):
if pnum not in self.partitions:
- raise WicError("Partition %s is not in the image")
+ raise WicError("Partition %s is not in the image" % pnum)
part = self.partitions[pnum]
# check if fstype is supported
for fstype in self.fstypes:
@@ -314,6 +314,9 @@ class Disk:
seek=self.partitions[pnum].start)
def dir(self, pnum, path):
+ if pnum not in self.partitions:
+ raise WicError("Partition %s is not in the image" % pnum)
+
if self.partitions[pnum].fstype.startswith('ext'):
return exec_cmd("{} {} -R 'ls -l {}'".format(self.debugfs,
self._get_part_image(pnum),