osbuild-image-info: exit with non-zero value on empty report
For the purpose of using this tool in tests (specifically for manifest tests where we diff image-info reports), it is important that the tools exists with non-zero value if the final report is empty. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
542cf4a799
commit
ce4bc01b7b
1 changed files with 4 additions and 0 deletions
|
|
@ -2950,6 +2950,10 @@ def main():
|
|||
else:
|
||||
report = analyse_image(target)
|
||||
|
||||
if not report:
|
||||
print(f"Failed to analyse {target}: no information gathered in the report", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
json.dump(report, sys.stdout, sort_keys=True, indent=2)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue