Tools/osbuild-image-info: rework analyse_iso()
Rework the function to actually fail in case it can't analyze the provided ISO. Previously, the tool would silently fail to analyze ISO, generate and generate an empty report. Fix this. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
b978559a80
commit
c69b16f333
1 changed files with 2 additions and 9 deletions
|
|
@ -2919,15 +2919,8 @@ def is_iso(path):
|
|||
|
||||
|
||||
def analyse_iso(path):
|
||||
with tempfile.TemporaryDirectory(dir="/var/tmp") as tmp:
|
||||
report = None
|
||||
subprocess.run(["mount", "-o", "loop", path, tmp], check=True)
|
||||
try:
|
||||
report = analyse_tarball(os.path.join(tmp, "liveimg.tar.gz"))
|
||||
except Exception as e:
|
||||
print(f"{e}", file=sys.stderr)
|
||||
subprocess.run(["umount", tmp], check=True)
|
||||
return report
|
||||
with mount(path, ["loop"]) as tmp:
|
||||
return analyse_tarball(os.path.join(tmp, "liveimg.tar.gz"))
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue