T7948: generate_bom.py: Fix mixed indentation format and fail on error
Since when generate_bom.py was initially developed it used tab for indentation and following improvements were done using spaces, there is a mix in indentation format.
In order to fix it switch to spaces since it is the preferred way and the one used in other Python scripts.
This fixes the following error
File "/home/user/infrastructure/apertis-image-recipes/./scripts/generate_bom.py", line 171
kwargs = {}
^
IndentationError: unindent does not match any outer indentation level
Additionally fix the issue of no pipeline failure when generate_bom.py fails since the exit code is masked by the piping to gzip.
Edited by Walter Lozano