bitbake-layers: Handle exception raised bytinfoil.prepare()
PATCH 1/1 bitbake-layers: Handle exception raised bytinfoil.prepare()
The tinfoil.prepare method can raise Exceptions when is parsing initial
data so add this call inside try, finally to avoid get blocked for
don't call tinfoil.shutdown().
The tinfoil_init function was remove because isn't make sense now since
tinfoil.prepare() needs to be inside try, finally closures.
Example of raised exception and gets blocked:
$ bitbake-layers add-layer ~/repos/meta-openembedded/meta-python/
Traceback (most recent call last):
File "/home/alimon/repos/poky/bitbake/bin/bitbake-layers", line 83, in
main
tinfoil.prepare(True)
...
File "/home/alimon/repos/poky/bitbake/lib/bb/tinfoil.py", line 268, inrun_command
raise TinfoilCommandFailed(result[1])
bb.tinfoil.TinfoilCommandFailed: Traceback (most recent call last):
File "/home/alimon/repos/poky/bitbake/lib/bb/command.py", line 81, in
runCommand
result = command_method(self, commandline)
...
File "/home/alimon/repos/poky/bitbake/lib/bb/cooker.py", line 1314, in
handleCollections
raise CollectionError("Errors during parsing layer configuration")
bb.cooker.CollectionError: Errors during parsing layer configuration
--- bin/bitbake-layers | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
bin/bitbake-layers +3 -10
@@ -31,15 +31,6 @@ sys.path[0:0] = [os.path.join(topdir, 'lib')] import bb.tinfoil - -def tinfoil_init(parserecipes): - import bb.tinfoil - tinfoil = bb.tinfoil.Tinfoil(tracking=True) - tinfoil.prepare(not parserecipes) - tinfoil.logger.setLevel(logger.getEffectiveLevel()) - return tinfoil - - def logger_create(name, output=sys.stderr): logger = logging.getLogger(name) loggerhandler = logging.StreamHandler(output)
@@ -86,8 +77,10 @@ def main(): logger_setup_color(logger, global_args.color) plugins = [] - tinfoil = tinfoil_init(False) + tinfoil = bb.tinfoil.Tinfoil(tracking=True) + tinfoil.logger.setLevel(logger.getEffectiveLevel()) try: + tinfoil.prepare(True) for path in ([topdir] + tinfoil.config_data.getVar('BBPATH').split(':')): pluginpath = os.path.join(path, 'lib', 'bblayers')
Signature · 1 line
2.1.4
ping
Quoted 67 lines · Aníbal Limón
The tinfoil.prepare method can raise Exceptions when is parsing initial
data so add this call inside try, finally to avoid get blocked for
don't calltinfoil.shutdown().The
tinfoil_initfunction was remove because isn't make sense now since
tinfoil.prepare()needs to be inside try, finally closures.Example of raised exception and gets blocked:
$ bitbake-layers add-layer ~/repos/meta-openembedded/meta-python/Traceback (most recent call last):
File "/home/alimon/repos/poky/bitbake/bin/bitbake-layers", line 83, in
main
tinfoil.prepare(True)
...
File "/home/alimon/repos/poky/bitbake/lib/bb/tinfoil.py", line 268, inrun_command
raiseTinfoilCommandFailed(result[1])
bb.tinfoil.TinfoilCommandFailed: Traceback (most recent call last):
File "/home/alimon/repos/poky/bitbake/lib/bb/command.py", line 81, in
runCommand
result =command_method(self, commandline)
...
File "/home/alimon/repos/poky/bitbake/lib/bb/cooker.py", line 1314, in
handleCollections
raiseCollectionError("Errors during parsing layer configuration")
bb.cooker.CollectionError: Errors during parsing layer configurationSigned-off-by Aníbal Limón <[email protected]>--- bin/bitbake-layers | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)bin/bitbake-layers +3
-10@@ -31,15 +31,6 @@ sys.path[0:0] = [os.path.join(topdir, 'lib')] import bb.tinfoil - -def tinfoil_init(parserecipes): - import bb.tinfoil - tinfoil = bb.tinfoil.Tinfoil(tracking=True) - tinfoil.prepare(not parserecipes) - tinfoil.logger.setLevel(logger.getEffectiveLevel()) - return tinfoil - - def logger_create(name, output=sys.stderr): logger = logging.getLogger(name) loggerhandler = logging.StreamHandler(output)@@ -86,8 +77,10 @@ def main(): logger_setup_color(logger, global_args.color) plugins = [] - tinfoil = tinfoil_init(False) + tinfoil = bb.tinfoil.Tinfoil(tracking=True) + tinfoil.logger.setLevel(logger.getEffectiveLevel()) try: + tinfoil.prepare(True) for path in ([topdir] + tinfoil.config_data.getVar('BBPATH').split(':')): pluginpath = os.path.join(path, 'lib', 'bblayers')