Remove unecessary function

There was only one caller to the change_node_state function, and
it was the one-line hold function.  Remove the unecessary indirection.

Change-Id: I13efc73edf807c8cb6b430f207bf7cb067520ba3
This commit is contained in:
James E. Blair 2022-11-30 06:49:17 -08:00
parent 1658aa9851
commit 44bf72785d

View File

@ -310,7 +310,7 @@ class NodePoolCmd(NodepoolApp):
self.list(node_id=node.id)
def _change_node_state(self, new_state):
def hold(self):
node = self.zk.getNode(self.args.id)
if not node:
print("Node id %s not found" % self.args.id)
@ -318,15 +318,12 @@ class NodePoolCmd(NodepoolApp):
self.zk.lockNode(node, blocking=True, timeout=5)
node.state = new_state
node.state = zk.HOLD
self.zk.storeNode(node)
self.zk.unlockNode(node)
self.list(node_id=node.id)
def hold(self):
self._change_node_state(zk.HOLD)
def dib_image_delete(self):
(image, build_num) = self.args.id.rsplit('-', 1)
build = self.zk.getBuild(image, build_num)