Commit 4a72cc75 authored by Iustin Pop's avatar Iustin Pop

Remove OpQueryNodeData and LUQueryNodeData

Now that LUQueryNodes supports all the functionality of LUQueryNodeData,
let's migrate gnt-node.ShowNodeConfig to use it and remove all traces of
OpQueryNodeData and LUQueryNodeData.

Reviewed-by: imsnah
parent ec223efb
......@@ -3308,37 +3308,6 @@ class LUQueryInstanceData(NoHooksLU):
return result
class LUQueryNodeData(NoHooksLU):
"""Logical unit for querying node data.
"""
_OP_REQP = ["nodes"]
def CheckPrereq(self):
"""Check prerequisites.
This only checks the optional node list against the existing names.
"""
self.wanted_nodes = _GetWantedNodes(self, self.op.nodes)
def Exec(self, feedback_fn):
"""Compute and return the list of nodes.
"""
ilist = [self.cfg.GetInstanceInfo(iname) for iname
in self.cfg.GetInstanceList()]
result = []
for node in [self.cfg.GetNodeInfo(name) for name in self.wanted_nodes]:
result.append((node.name, node.primary_ip, node.secondary_ip,
[inst.name for inst in ilist
if inst.primary_node == node.name],
[inst.name for inst in ilist
if node.name in inst.secondary_nodes],
))
return result
class LUSetInstanceParms(LogicalUnit):
"""Modifies an instances's parameters.
......
......@@ -52,7 +52,6 @@ class Processor(object):
# node lu
opcodes.OpAddNode: cmdlib.LUAddNode,
opcodes.OpQueryNodes: cmdlib.LUQueryNodes,
opcodes.OpQueryNodeData: cmdlib.LUQueryNodeData,
opcodes.OpQueryNodeVolumes: cmdlib.LUQueryNodeVolumes,
opcodes.OpRemoveNode: cmdlib.LURemoveNode,
# instance lu
......
......@@ -116,12 +116,6 @@ class OpQueryNodes(OpCode):
__slots__ = ["output_fields", "nodes"]
class OpQueryNodeData(OpCode):
"""Compute the node info."""
OP_ID = "OP_NODE_INFO"
__slots__ = ["nodes"]
class OpQueryNodeVolumes(OpCode):
"""Get list of volumes on node."""
OP_ID = "OP_NODE_QUERYVOLS"
......
......@@ -91,7 +91,9 @@ def ShowNodeConfig(opts, args):
"""Show node information.
"""
op = opcodes.OpQueryNodeData(nodes=args)
op = opcodes.OpQueryNodes(output_fields=["name", "pip", "sip",
"pinst_list", "sinst_list"],
nodes=args)
result = SubmitOpCode(op)
for name, primary_ip, secondary_ip, pinst, sinst in result:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment