summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-03-20 16:50:44 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2017-03-20 17:12:48 +1300
commit23a6304054effdca8fb9dd43557aa1ac70bebd32 (patch)
treebfbeaf4b2220ebaf7a1508b9039aaf740ae0a2f3
parenta73b834c249d63e028ad6afd15a14c7cb7cf00b9 (diff)
downloadopenembedded-core-contrib-paule/tinfoil2-fixes-oecore.tar.gz
openembedded-core-contrib-paule/tinfoil2-fixes-oecore.tar.bz2
openembedded-core-contrib-paule/tinfoil2-fixes-oecore.zip
devtool: tidy up handling of parse failurespaule/tinfoil2-fixes-oecore
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>
-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