rrs_upgrade_history.py: ensure we shut down tinfoil safely

Use try...finally to ensure we shut down tinfoil, but since we are
potentially dealing with older bitbake releases when importing older
upgrades, only call shutdown() if it's actually there (and although it's
unlikely, guard against the broken shutdown() in fido as we do in the
main layer index update script).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2018-03-26 16:59:32 +13:00
parent ba27f9fee0
commit acac7d6e9c

View File

@ -178,6 +178,7 @@ def generate_history(options, layerbranch_id, commit, logger):
(tinfoil, d, recipes) = load_recipes(layerbranch, bitbakepath,
fetchdir, settings, logger, recipe_files=fns,
nocheckout=True)
try:
if options.initial:
title = options.initial
@ -201,6 +202,8 @@ def generate_history(options, layerbranch_id, commit, logger):
except DryRunRollbackException:
pass
finally:
if tinfoil and hasattr(tinfoil, 'shutdown') and (LooseVersion(bb.__version__) > LooseVersion("1.27")):
tinfoil.shutdown()