Remove unecessary finally clauses

These clauses are attached to exception handlers which always
proceed, and are therefore unecessary and can be a little confusing
when reading the code.

Change-Id: Ic01d48bf4a0d935a4f32bc28aae13551b4b66e7f
This commit is contained in:
James E. Blair 2019-01-03 10:22:58 -08:00
parent 7d3ad9a7aa
commit 3ddce68728
2 changed files with 5 additions and 7 deletions

View File

@ -437,10 +437,9 @@ class PipelineManager(object):
except Exception:
self.log.exception("Exception while canceling build %s "
"for change %s" % (build, item.change))
finally:
tenant = old_build_set.item.pipeline.tenant
tenant.semaphore_handler.release(
old_build_set.item, build.job)
tenant = old_build_set.item.pipeline.tenant
tenant.semaphore_handler.release(
old_build_set.item, build.job)
if not was_running:
nodeset = build.build_set.getJobNodeSet(build.job.name)

View File

@ -837,9 +837,8 @@ class Scheduler(threading.Thread):
self.log.exception(
"Exception while removing nodeset from build %s "
"for change %s" % (build, build.build_set.item.change))
finally:
tenant.semaphore_handler.release(
build.build_set.item, build.job)
tenant.semaphore_handler.release(
build.build_set.item, build.job)
def _reconfigureTenant(self, tenant):
# This is called from _doReconfigureEvent while holding the