Commit 246e180a authored by Iustin Pop's avatar Iustin Pop

Change OpQueryNodes nodes attribute to names

Change this to have the exact same parameters as OpQueryInstances.

Also fix burnin which is broken since r146.

Reviewed-by: imsnah
parent 069dcc86
......@@ -1129,7 +1129,7 @@ class LUQueryNodes(NoHooksLU):
"""Logical unit for querying nodes.
"""
_OP_REQP = ["output_fields", "nodes"]
_OP_REQP = ["output_fields", "names"]
def CheckPrereq(self):
"""Check prerequisites.
......@@ -1146,13 +1146,13 @@ class LUQueryNodes(NoHooksLU):
dynamic=self.dynamic_fields,
selected=self.op.output_fields)
self.wanted_nodes = _GetWantedNodes(self, self.op.nodes)
self.wanted = _GetWantedNodes(self, self.op.names)
def Exec(self, feedback_fn):
"""Computes the list of nodes and their attributes.
"""
nodenames = self.wanted_nodes
nodenames = self.wanted
nodelist = [self.cfg.GetNodeInfo(name) for name in nodenames]
# begin data gathering
......
......@@ -113,7 +113,7 @@ class OpAddNode(OpCode):
class OpQueryNodes(OpCode):
"""Compute the list of nodes."""
OP_ID = "OP_NODE_QUERY"
__slots__ = ["output_fields", "nodes"]
__slots__ = ["output_fields", "names"]
class OpQueryNodeVolumes(OpCode):
......
......@@ -45,7 +45,7 @@ def ListNodes(opts, args):
else:
selected_fields = opts.output.split(",")
op = opcodes.OpQueryNodes(output_fields=selected_fields, nodes=[])
op = opcodes.OpQueryNodes(output_fields=selected_fields, names=[])
output = SubmitOpCode(op)
if not opts.no_headers:
......@@ -93,7 +93,7 @@ def ShowNodeConfig(opts, args):
"""
op = opcodes.OpQueryNodes(output_fields=["name", "pip", "sip",
"pinst_list", "sinst_list"],
nodes=args)
names=args)
result = SubmitOpCode(op)
for name, primary_ip, secondary_ip, pinst, sinst in result:
......
......@@ -82,8 +82,8 @@ def BurninCluster(opts, args):
logger.SetupLogging(debug=True, program="ganeti/burnin")
proc = mcpu.Processor()
result = proc.ExecOpCode(opcodes.OpQueryNodes(output_fields=["name"]),
Feedback)
result = proc.ExecOpCode(opcodes.OpQueryNodes(output_fields=["name"],
names=[]), Feedback)
nodelist = [data[0] for data in result]
Feedback("- Testing global parameters")
......
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