mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-05 21:24:46 +02:00
rrs/tools: handle dry-run properly
In the case of dry-run a couple of the scripts were breaking out after one layerbranch had been processed due to the code structure. Handle the exception within the block for the layerbranch to avoid this. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
0201a86f0d
commit
9d0e048ded
|
@ -112,9 +112,7 @@ if __name__=="__main__":
|
|||
|
||||
logger.debug("Starting recipe distros update ...")
|
||||
|
||||
try:
|
||||
origsyspath = sys.path
|
||||
with transaction.atomic():
|
||||
for maintplan in maintplans:
|
||||
for item in maintplan.maintenanceplanlayerbranch_set.all():
|
||||
layerbranch = item.layerbranch
|
||||
|
@ -125,6 +123,8 @@ if __name__=="__main__":
|
|||
if not recipes:
|
||||
continue
|
||||
|
||||
try:
|
||||
with transaction.atomic():
|
||||
utils.setup_core_layer_sys_path(settings, layerbranch.branch.name)
|
||||
|
||||
from oe import distro_check
|
||||
|
@ -153,10 +153,10 @@ if __name__=="__main__":
|
|||
recipedistro.save()
|
||||
logger.debug('%s: layer branch %s, add distro %s alias %s' % (pn,
|
||||
str(layerbranch), distro, alias))
|
||||
finally:
|
||||
tinfoil.shutdown()
|
||||
shutil.rmtree(tempdir)
|
||||
if options.dry_run:
|
||||
raise DryRunRollbackException
|
||||
except DryRunRollbackException:
|
||||
pass
|
||||
finally:
|
||||
tinfoil.shutdown()
|
||||
shutil.rmtree(tempdir)
|
||||
|
|
|
@ -178,6 +178,7 @@ if __name__=="__main__":
|
|||
for maintplan in maintplans:
|
||||
for item in maintplan.maintenanceplanlayerbranch_set.all():
|
||||
layerbranch = item.layerbranch
|
||||
try:
|
||||
with transaction.atomic():
|
||||
sys.path = origsyspath
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user