Merge "Spell NodeSet consistently" into feature/zuulv3

changes/88/422288/4
Jenkins 6 years ago committed by Gerrit Code Review
commit 7f238a2991

@ -79,12 +79,12 @@ class TestNodepool(BaseTestCase):
self.assertEqual(node.state, 'ready')
# Mark the nodes in use
self.nodepool.useNodeset(nodeset)
self.nodepool.useNodeSet(nodeset)
for node in nodeset.getNodes():
self.assertEqual(node.state, 'in-use')
# Return the nodes
self.nodepool.returnNodeset(nodeset)
self.nodepool.returnNodeSet(nodeset)
for node in nodeset.getNodes():
self.assertIsNone(node.lock)
self.assertEqual(node.state, 'used')

@ -365,7 +365,7 @@ class PipelineManager(object):
self.log.debug("Found job %s for change %s" % (job, item.change))
try:
nodeset = item.current_build_set.getJobNodeSet(job.name)
self.sched.nodepool.useNodeset(nodeset)
self.sched.nodepool.useNodeSet(nodeset)
build = self.sched.launcher.launch(job, item,
self.pipeline,
dependent_items)
@ -406,7 +406,7 @@ class PipelineManager(object):
if not was_running:
try:
nodeset = build.build_set.getJobNodeSet(build.job.name)
self.sched.nodepool.returnNodeset(nodeset)
self.sched.nodepool.returnNodeSet(nodeset)
except Exception:
self.log.exception("Unable to return nodeset %s for "
"canceled build request %s" %
@ -417,7 +417,7 @@ class PipelineManager(object):
for jobname, nodeset in old_build_set.nodesets.items()[:]:
if jobname in canceled_jobs:
continue
self.sched.nodepool.returnNodeset(nodeset)
self.sched.nodepool.returnNodeSet(nodeset)
for item_behind in item.items_behind:
self.log.debug("Canceling jobs for change %s, behind change %s" %
(item_behind.change, item.change))
@ -623,7 +623,7 @@ class PipelineManager(object):
for build in build.build_set.getBuilds():
if build.result == 'SKIPPED':
nodeset = build.build_set.getJobNodeSet(build.job.name)
self.sched.nodepool.returnNodeset(nodeset)
self.sched.nodepool.returnNodeSet(nodeset)
return True

@ -44,7 +44,7 @@ class Nodepool(object):
self.log.exception("Error deleting node request:")
del self.requests[request.uid]
def useNodeset(self, nodeset):
def useNodeSet(self, nodeset):
self.log.info("Setting nodeset %s in use" % (nodeset,))
for node in nodeset.getNodes():
if node.lock is None:
@ -52,7 +52,7 @@ class Nodepool(object):
node.state = model.STATE_IN_USE
self.sched.zk.storeNode(node)
def returnNodeset(self, nodeset):
def returnNodeSet(self, nodeset):
self.log.info("Returning nodeset %s" % (nodeset,))
for node in nodeset.getNodes():
if node.lock is None:
@ -62,7 +62,7 @@ class Nodepool(object):
self.sched.zk.storeNode(node)
self._unlockNodes(nodeset.getNodes())
def unlockNodeset(self, nodeset):
def unlockNodeSet(self, nodeset):
self._unlockNodes(nodeset.getNodes())
def _unlockNodes(self, nodes):
@ -72,7 +72,7 @@ class Nodepool(object):
except Exception:
self.log.exception("Error unlocking node:")
def lockNodeset(self, nodeset):
def lockNodeSet(self, nodeset):
self._lockNodes(nodeset.getNodes())
def _lockNodes(self, nodes):
@ -123,7 +123,7 @@ class Nodepool(object):
if request.fulfilled:
# If the request suceeded, try to lock the nodes.
try:
self.lockNodeset(request.nodeset)
self.lockNodeSet(request.nodeset)
locked = True
except Exception:
self.log.exception("Error locking nodes:")
@ -141,4 +141,4 @@ class Nodepool(object):
# nodes, unlock the nodes since we're not going to use
# them.
if locked:
self.unlockNodeset(request.nodeset)
self.unlockNodeSet(request.nodeset)

@ -773,7 +773,7 @@ class Scheduler(threading.Thread):
# the nodes to nodepool.
try:
nodeset = build.build_set.getJobNodeSet(build.job.name)
self.nodepool.returnNodeset(nodeset)
self.nodepool.returnNodeSet(nodeset)
except Exception:
self.log.exception("Unable to return nodeset %s" % (nodeset,))
@ -816,14 +816,14 @@ class Scheduler(threading.Thread):
if build_set is not build_set.item.current_build_set:
self.log.warning("Build set %s is not current" % (build_set,))
if request.fulfilled:
self.nodepool.returnNodeset(request.nodeset)
self.nodepool.returnNodeSet(request.nodeset)
return
pipeline = build_set.item.pipeline
if not pipeline:
self.log.warning("Build set %s is not associated with a pipeline" %
(build_set,))
if request.fulfilled:
self.nodepool.returnNodeset(request.nodeset)
self.nodepool.returnNodeSet(request.nodeset)
return
pipeline.manager.onNodesProvisioned(event)

Loading…
Cancel
Save