Revision 2e7b8369

b/lib/cli.py
944 944
  if cl is None:
945 945
    cl = GetClient()
946 946

  
947
  op = opcodes.OpQueryNodes(output_fields=["name", "offline"],
948
                            names=nodes)
949
  result = SubmitOpCode(op, cl=cl)
947
  result = cl.QueryNodes(names=nodes, fields=["name", "offline"],
948
                         use_locking=False)
950 949
  offline = [row[0] for row in result if row[1]]
951 950
  if offline and not nowarn:
952 951
    ToStderr("Note: skipping offline node(s): %s" % ", ".join(offline))
b/scripts/gnt-cluster
202 202
  @return: the desired exit code
203 203

  
204 204
  """
205
  op = opcodes.OpQueryClusterInfo()
206
  result = SubmitOpCode(op)
205
  cl = GetClient()
206
  result = cl.QueryClusterInfo()
207 207
  ToStdout("Software version: %s", result["software_version"])
208 208
  ToStdout("Internode protocol: %s", result["protocol_version"])
209 209
  ToStdout("Configuration format: %s", result["config_version"])
......
236 236
  @return: the desired exit code
237 237

  
238 238
  """
239
  op = opcodes.OpQueryClusterInfo()
240
  result = SubmitOpCode(op)
239
  cl = GetClient()
240
  result = cl.QueryClusterInfo()
241 241

  
242 242
  ToStdout("Cluster name: %s", result["name"])
243 243

  
b/scripts/gnt-node
182 182
  selected_fields = ["name", "sinst_list"]
183 183
  src_node = args[0]
184 184

  
185
  op = opcodes.OpQueryNodes(output_fields=selected_fields, names=[src_node])
186 185
  result = cl.QueryNodes(names=[src_node], fields=selected_fields,
187 186
                         use_locking=True)
188 187
  src_node, sinst = result[0]
......
238 237
  force = opts.force
239 238
  selected_fields = ["name", "pinst_list"]
240 239

  
241
  op = opcodes.OpQueryNodes(output_fields=selected_fields, names=args)
242
  result = SubmitOpCode(op, cl=cl)
240
  # these fields are static data anyway, so it doesn't matter, but
241
  # locking=True should be safer
242
  result = cl.QueryNodes(names=args, fields=selected_fields,
243
                         use_locking=True)
243 244
  node, pinst = result[0]
244 245

  
245 246
  if not pinst:
......
320 321
  @return: the desired exit code
321 322

  
322 323
  """
323
  op = opcodes.OpQueryNodes(output_fields=["name", "pip", "sip",
324
                                           "pinst_list", "sinst_list"],
325
                            names=args)
326
  result = SubmitOpCode(op)
324
  cl = GetClient()
325
  result = cl.QueryNodes(fields=["name", "pip", "sip",
326
                                 "pinst_list", "sinst_list"],
327
                         names=args, use_locking=True)
327 328

  
328 329
  for name, primary_ip, secondary_ip, pinst, sinst in result:
329 330
    ToStdout("Node name: %s", name)

Also available in: Unified diff