mirror of
https://git.yoctoproject.org/poky
synced 2026-03-19 13:49:41 +01:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
9165187275
commit
26525f2f4f
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user