summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-03 23:00:23 +0000
committerGerrit Code Review <review@openstack.org>2019-01-03 23:00:23 +0000
commit3f03cf43b92bc390fdc0ec70eceb6646f82ed822 (patch)
tree2da0d90b8424f121785d72c088f3f07ede099b1b
parent642b52b6b2a1732bfb2f42fd131fc04efb3f0ae9 (diff)
parent3ddce68728eeb0a00e9647feab2f53a14918eceb (diff)
Merge "Remove unecessary finally clauses"
-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