Revision 246e180a
b/lib/cmdlib.py | ||
---|---|---|
1129 | 1129 |
"""Logical unit for querying nodes. |
1130 | 1130 |
|
1131 | 1131 |
""" |
1132 |
_OP_REQP = ["output_fields", "nodes"]
|
|
1132 |
_OP_REQP = ["output_fields", "names"]
|
|
1133 | 1133 |
|
1134 | 1134 |
def CheckPrereq(self): |
1135 | 1135 |
"""Check prerequisites. |
... | ... | |
1146 | 1146 |
dynamic=self.dynamic_fields, |
1147 | 1147 |
selected=self.op.output_fields) |
1148 | 1148 |
|
1149 |
self.wanted_nodes = _GetWantedNodes(self, self.op.nodes)
|
|
1149 |
self.wanted = _GetWantedNodes(self, self.op.names)
|
|
1150 | 1150 |
|
1151 | 1151 |
def Exec(self, feedback_fn): |
1152 | 1152 |
"""Computes the list of nodes and their attributes. |
1153 | 1153 |
|
1154 | 1154 |
""" |
1155 |
nodenames = self.wanted_nodes
|
|
1155 |
nodenames = self.wanted |
|
1156 | 1156 |
nodelist = [self.cfg.GetNodeInfo(name) for name in nodenames] |
1157 | 1157 |
|
1158 | 1158 |
# begin data gathering |
b/lib/opcodes.py | ||
---|---|---|
113 | 113 |
class OpQueryNodes(OpCode): |
114 | 114 |
"""Compute the list of nodes.""" |
115 | 115 |
OP_ID = "OP_NODE_QUERY" |
116 |
__slots__ = ["output_fields", "nodes"]
|
|
116 |
__slots__ = ["output_fields", "names"]
|
|
117 | 117 |
|
118 | 118 |
|
119 | 119 |
class OpQueryNodeVolumes(OpCode): |
b/scripts/gnt-node | ||
---|---|---|
45 | 45 |
else: |
46 | 46 |
selected_fields = opts.output.split(",") |
47 | 47 |
|
48 |
op = opcodes.OpQueryNodes(output_fields=selected_fields, nodes=[])
|
|
48 |
op = opcodes.OpQueryNodes(output_fields=selected_fields, names=[])
|
|
49 | 49 |
output = SubmitOpCode(op) |
50 | 50 |
|
51 | 51 |
if not opts.no_headers: |
... | ... | |
93 | 93 |
""" |
94 | 94 |
op = opcodes.OpQueryNodes(output_fields=["name", "pip", "sip", |
95 | 95 |
"pinst_list", "sinst_list"], |
96 |
nodes=args)
|
|
96 |
names=args)
|
|
97 | 97 |
result = SubmitOpCode(op) |
98 | 98 |
|
99 | 99 |
for name, primary_ip, secondary_ip, pinst, sinst in result: |
b/tools/burnin | ||
---|---|---|
82 | 82 |
|
83 | 83 |
logger.SetupLogging(debug=True, program="ganeti/burnin") |
84 | 84 |
proc = mcpu.Processor() |
85 |
result = proc.ExecOpCode(opcodes.OpQueryNodes(output_fields=["name"]),
|
|
86 |
Feedback) |
|
85 |
result = proc.ExecOpCode(opcodes.OpQueryNodes(output_fields=["name"], |
|
86 |
names=[]), Feedback)
|
|
87 | 87 |
nodelist = [data[0] for data in result] |
88 | 88 |
|
89 | 89 |
Feedback("- Testing global parameters") |
Also available in: Unified diff