summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-03-20 17:16:20 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-21 22:43:02 +0000
commit18304036e1b513fd12c049dbf549ba75c503ed84 (patch)
treee0dfc6dc32e7306251b00ff19249799a06bcf769
parent4eb3c705b9cadccacdb191ae89f5242a00f397f3 (diff)
downloadopenembedded-core-18304036e1b513fd12c049dbf549ba75c503ed84.tar.gz
openembedded-core-18304036e1b513fd12c049dbf549ba75c503ed84.tar.bz2
openembedded-core-18304036e1b513fd12c049dbf549ba75c503ed84.zip
devtool: tidy up handling of parse failures
Since the tinfoil2 refactoring, if an error occurred during parsing, we were showing a traceback and not correctly exiting (since we weren't calling shutdown()). Fix both of these issues. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--scripts/lib/devtool/__init__.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 91111e1109..8c385beb89 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -114,8 +114,15 @@ def setup_tinfoil(config_only=False, basepath=None, tracking=False):
import bb.tinfoil
tinfoil = bb.tinfoil.Tinfoil(tracking=tracking)
- tinfoil.prepare(config_only)
- tinfoil.logger.setLevel(logger.getEffectiveLevel())
+ try:
+ tinfoil.prepare(config_only)
+ tinfoil.logger.setLevel(logger.getEffectiveLevel())
+ except bb.tinfoil.TinfoilUIException:
+ tinfoil.shutdown()
+ raise DevtoolError('Failed to start bitbake environment')
+ except:
+ tinfoil.shutdown()
+ raise
finally:
os.chdir(orig_cwd)
return tinfoil