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): ...@@ -3308,37 +3308,6 @@ class LUQueryInstanceData(NoHooksLU):
return result 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.primary_ip, node.secondary_ip,
[ for inst in ilist
if inst.primary_node ==],
[ for inst in ilist
if in inst.secondary_nodes],
return result
class LUSetInstanceParms(LogicalUnit): class LUSetInstanceParms(LogicalUnit):
"""Modifies an instances's parameters. """Modifies an instances's parameters.
...@@ -52,7 +52,6 @@ class Processor(object): ...@@ -52,7 +52,6 @@ class Processor(object):
# node lu # node lu
opcodes.OpAddNode: cmdlib.LUAddNode, opcodes.OpAddNode: cmdlib.LUAddNode,
opcodes.OpQueryNodes: cmdlib.LUQueryNodes, opcodes.OpQueryNodes: cmdlib.LUQueryNodes,
opcodes.OpQueryNodeData: cmdlib.LUQueryNodeData,
opcodes.OpQueryNodeVolumes: cmdlib.LUQueryNodeVolumes, opcodes.OpQueryNodeVolumes: cmdlib.LUQueryNodeVolumes,
opcodes.OpRemoveNode: cmdlib.LURemoveNode, opcodes.OpRemoveNode: cmdlib.LURemoveNode,
# instance lu # instance lu
...@@ -116,12 +116,6 @@ class OpQueryNodes(OpCode): ...@@ -116,12 +116,6 @@ class OpQueryNodes(OpCode):
__slots__ = ["output_fields", "nodes"] __slots__ = ["output_fields", "nodes"]
class OpQueryNodeData(OpCode):
"""Compute the node info."""
__slots__ = ["nodes"]
class OpQueryNodeVolumes(OpCode): class OpQueryNodeVolumes(OpCode):
"""Get list of volumes on node.""" """Get list of volumes on node."""
...@@ -91,7 +91,9 @@ def ShowNodeConfig(opts, args): ...@@ -91,7 +91,9 @@ def ShowNodeConfig(opts, args):
"""Show node information. """Show node information.
""" """
op = opcodes.OpQueryNodeData(nodes=args) op = opcodes.OpQueryNodes(output_fields=["name", "pip", "sip",
"pinst_list", "sinst_list"],
result = SubmitOpCode(op) result = SubmitOpCode(op)
for name, primary_ip, secondary_ip, pinst, sinst in result: 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