From 15748efcc18e0576dd9bee2acd8f35814f568c2d Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Mon, 16 Jan 2017 09:26:56 +1300 Subject: [PATCH] update_layer: fix tinfoil shutdown Fix a couple of problems with shutting down tinfoil: 1) tinfoil.shutdown() wasn't being called on error because it wasn't inside a finally: section, thus on error the script hung with bitbake master (since the tinfoil2 changes) - this is almost certainly a bug in bitbake but let's handle it here anyway. 2) We need to check whether the tinfoil object actually has a shutdown attribute since we still want to support updating for older branches where tinfoil didn't have a shutdown() method. Signed-off-by: Paul Eggleton --- layerindex/update_layer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layerindex/update_layer.py b/layerindex/update_layer.py index 3936606..3497ac5 100644 --- a/layerindex/update_layer.py +++ b/layerindex/update_layer.py @@ -678,8 +678,10 @@ def main(): except: import traceback traceback.print_exc() + finally: + if hasattr(tinfoil, 'shutdown'): + tinfoil.shutdown() - tinfoil.shutdown() shutil.rmtree(tempdir) sys.exit(0)