Rename Node.hold_reason to 'comment'
The nodepool ZooKeeper model already has a 'comment' field. Zuul should just use that instead, keeping the models in sync. Change-Id: Ia1aacc756351ba87ccb78e249e6b19e6ea86a188
This commit is contained in:
@@ -1470,7 +1470,7 @@ class TestScheduler(ZuulTestCase):
|
||||
'review.example.com/org/project',
|
||||
'project-test2'])
|
||||
)
|
||||
self.assertEqual(held_node['hold_reason'], "reason text")
|
||||
self.assertEqual(held_node['comment'], "reason text")
|
||||
|
||||
# Another failed change should not hold any more nodes
|
||||
B = self.fake_gerrit.addFakeChange('org/project', 'master', 'B')
|
||||
|
||||
+2
-2
@@ -357,7 +357,7 @@ class Node(object):
|
||||
self.id = None
|
||||
self.lock = None
|
||||
self.hold_job = None
|
||||
self.hold_reason = None
|
||||
self.comment = None
|
||||
# Attributes from Nodepool
|
||||
self._state = 'unknown'
|
||||
self.state_time = time.time()
|
||||
@@ -399,7 +399,7 @@ class Node(object):
|
||||
d = {}
|
||||
d['state'] = self.state
|
||||
d['hold_job'] = self.hold_job
|
||||
d['hold_reason'] = self.hold_reason
|
||||
d['comment'] = self.comment
|
||||
for k in self._keys:
|
||||
d[k] = getattr(self, k)
|
||||
return d
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ class Nodepool(object):
|
||||
for node in nodes:
|
||||
node.state = model.STATE_HOLD
|
||||
node.hold_job = " ".join(autohold_key)
|
||||
node.hold_reason = reason
|
||||
node.comment = reason
|
||||
self.sched.zk.storeNode(node)
|
||||
|
||||
# We remove the autohold when the number of nodes in hold
|
||||
|
||||
Reference in New Issue
Block a user