From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: bitbake-devel@lists.openembedded.org
Cc: paul.eggleton@linux.intel.com
Subject: [PATCH] bitbake-layers: Handle exception raised bytinfoil.prepare()
Date: Thu, 2 Feb 2017 16:29:21 -0600 [thread overview]
Message-ID: <1486074561-27644-1-git-send-email-anibal.limon@linux.intel.com> (raw)
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, in
run_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
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
bin/bitbake-layers | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/bin/bitbake-layers b/bin/bitbake-layers
index 1e2cfbc..66fc7ca 100755
--- a/bin/bitbake-layers
+++ b/bin/bitbake-layers
@@ -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')
--
2.1.4
next reply other threads:[~2017-02-02 22:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 22:29 Aníbal Limón [this message]
2017-02-14 16:32 ` [PATCH] bitbake-layers: Handle exception raised bytinfoil.prepare() Aníbal Limón
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1486074561-27644-1-git-send-email-anibal.limon@linux.intel.com \
--to=anibal.limon@linux.intel.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=paul.eggleton@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.