cookerdata: Fix log messages and ensure we exit
PATCH 1/1 cookerdata: Fix log messages and ensure we exit
The string formatting wasn't correct and we should exit if we hit errors here similar to the other exception handlers.
lib/bb/cookerdata.py +2 -1
@@ -192,7 +192,8 @@ def catch_parse_error(func): fn, _, _, _ = traceback.extract_tb(tb, 1)[0] if not fn.startswith(bbdir): break - parselog.critical("Unable to parse %s", fn, exc_info=(exc_class, exc, tb)) + parselog.critical("Unable to parse %s" % fn, exc_info=(exc_class, exc, tb)) + sys.exit(1) except bb.parse.ParseError as exc: parselog.critical(str(exc)) sys.exit(1)
Quoted 10 lines · Richard Purdie
The string formatting wasn't correct and we should exit if we hit errors here similar to the other exception handlers.
Signed-off-by Richard Purdie <[email protected]>lib/bb/cookerdata.py +0
-0
lib/bb/cookerdata.py def catch_parse_error(func): · line 199
Quoted 9 lines
lib/bb/cookerdata.py +2
-1@@ -192,7 +192,8 @@ def catch_parse_error(func): fn, _, _, _ = traceback.extract_tb(tb, 1)[0] if not fn.startswith(bbdir): break - parselog.critical("Unable to parse %s", fn, exc_info=(exc_class, exc, tb)) + parselog.critical("Unable to parse %s" % fn, exc_info=(exc_class, exc, tb)) + sys.exit(1)
The python logging module supports passing the % format values as arguments, you don't have to format the string at call time. What was the error here?
Signature · 5 lines
Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics
Quoted 17 lines · Christopher Larson
Quoted 14 lines · Richard Purdie
The string formatting wasn't correct and we should exit if we hit errors here similar to the other exception handlers.
Signed-off-by Richard Purdie <[email protected]>lib/bb/cookerdata.py +0
-1@@ -192,7 +192,8 @@ def catch_parse_error(func): fn, _, _, _ = traceback.extract_tb(tb, 1)[0] if not fn.startswith(bbdir): break - parselog.critical("Unable to parse %s", fn,
Quoted 8 lines
lib/bb/cookerdata.py def catch_parse_error(func): · line 199
Quoted 5 lines
lib/bb/cookerdata.py +2
-0exc_info=(exc_class, exc, tb)) + parselog.critical("Unable to parse %s" % fn, exc_info=(exc_class, exc, tb)) + sys.exit(1)The python logging module supports passing the % format values as arguments, you don't have to format the string at call time. What was the error here?
I had a whole load of debug here and distilled it down to this as it looked inconsistent with the rest of our code. Its possible the real problem was with exc_info as mentioned in another patch...
Cheers,
Richard