summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2019-01-03 10:22:58 -0800
committerJames E. Blair <jeblair@redhat.com>2019-01-03 10:22:58 -0800
commit3ddce68728eeb0a00e9647feab2f53a14918eceb (patch)
tree7e1c8e94c2e89b69b9195cedf743dcd584cd7f3d
parent7d3ad9a7aa0f1bebf54ece9ec390948e8e16b3c2 (diff)
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
Notes
Notes (review): Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Code-Review+2: Monty Taylor <mordred@inaugust.com> Workflow+1: Monty Taylor <mordred@inaugust.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 03 Jan 2019 23:00:23 +0000 Reviewed-on: https://review.openstack.org/628299 Project: openstack-infra/zuul Branch: refs/heads/master
-rw-r--r--zuul/manager/__init__.py7
-rw-r--r--zuul/scheduler.py5
2 files changed, 5 insertions, 7 deletions
diff --git a/zuul/manager/__init__.py b/zuul/manager/__init__.py
index 62b42a5..359d73d 100644
--- a/zuul/manager/__init__.py
+++ b/zuul/manager/__init__.py
@@ -437,10 +437,9 @@ class PipelineManager(object):
437 except Exception: 437 except Exception:
438 self.log.exception("Exception while canceling build %s " 438 self.log.exception("Exception while canceling build %s "
439 "for change %s" % (build, item.change)) 439 "for change %s" % (build, item.change))
440 finally: 440 tenant = old_build_set.item.pipeline.tenant
441 tenant = old_build_set.item.pipeline.tenant 441 tenant.semaphore_handler.release(
442 tenant.semaphore_handler.release( 442 old_build_set.item, build.job)
443 old_build_set.item, build.job)
444 443
445 if not was_running: 444 if not was_running:
446 nodeset = build.build_set.getJobNodeSet(build.job.name) 445 nodeset = build.build_set.getJobNodeSet(build.job.name)
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index fdd97b3..0be456e 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -837,9 +837,8 @@ class Scheduler(threading.Thread):
837 self.log.exception( 837 self.log.exception(
838 "Exception while removing nodeset from build %s " 838 "Exception while removing nodeset from build %s "
839 "for change %s" % (build, build.build_set.item.change)) 839 "for change %s" % (build, build.build_set.item.change))
840 finally: 840 tenant.semaphore_handler.release(
841 tenant.semaphore_handler.release( 841 build.build_set.item, build.job)
842 build.build_set.item, build.job)
843 842
844 def _reconfigureTenant(self, tenant): 843 def _reconfigureTenant(self, tenant):
845 # This is called from _doReconfigureEvent while holding the 844 # This is called from _doReconfigureEvent while holding the