Merge "Rename Node.hold_reason to 'comment'" into feature/zuulv3

This commit is contained in:
Jenkins 2017-08-02 06:33:49 +00:00 committed by Gerrit Code Review
commit 6665c1a358
3 changed files with 4 additions and 4 deletions

View File

@ -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')

View File

@ -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

View File

@ -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