mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/misra: xen-analysis.py: fix return error on PhaseExceptions
Currently the script return code is 0 even if an exception is
found, because the return code is written only if the exception
object has the errorcode member.
Fix the issue returning the errorcode member in case it exists,
otherwise use a generic value different from 0.
Fixes: 02b26c02c7 ("xen/scripts: add cppcheck tool to the xen-analysis.py script")
Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
dde20f7dc1
commit
09c7179f0a
1 file changed
+1
-2
@@ -26,8 +26,7 @@ def main(argv):
|
||||
cppcheck_analysis.generate_cppcheck_report()
|
||||
except PhaseExceptions as e:
|
||||
print("ERROR: {}".format(e))
|
||||
if hasattr(e, "errorcode"):
|
||||
ret_code = e.errorcode
|
||||
ret_code = getattr(e, "errorcode", 1)
|
||||
finally:
|
||||
if settings.step_clean_analysis:
|
||||
cppcheck_analysis.clean_analysis_artifacts()
|
||||
|
||||