Revision 2af8b9c9 lib/client/gnt_node.py

b/lib/client/gnt_node.py
233 233

  
234 234
  """
235 235
  cl = GetClient()
236
  query_cl = GetClient(query=True)
237 236
  node = netutils.GetHostname(name=args[0]).name
238 237
  readd = opts.readd
239 238

  
......
242 241
  try:
243 242
    # Passing [] to QueryGroups means query the default group:
244 243
    node_groups = [opts.nodegroup] if opts.nodegroup is not None else []
245
    output = query_cl.QueryGroups(names=node_groups, fields=["ndp/ssh_port"],
246
                                  use_locking=False)
244
    output = cl.QueryGroups(names=node_groups, fields=["ndp/ssh_port"],
245
                            use_locking=False)
247 246
    (ssh_port, ) = output[0]
248 247
  except (errors.OpPrereqError, errors.OpExecError):
249 248
    pass
250 249

  
251 250
  try:
252
    output = query_cl.QueryNodes(names=[node],
253
                                 fields=["name", "sip", "master",
254
                                         "ndp/ssh_port"],
255
                                 use_locking=False)
251
    output = cl.QueryNodes(names=[node],
252
                           fields=["name", "sip", "master",
253
                                   "ndp/ssh_port"],
254
                           use_locking=False)
256 255
    node_exists, sip, is_master, ssh_port = output[0]
257 256
  except (errors.OpPrereqError, errors.OpExecError):
258 257
    node_exists = ""
......
320 319
  fmtoverride = dict.fromkeys(["pinst_list", "sinst_list", "tags"],
321 320
                              (",".join, False))
322 321

  
323
  cl = GetClient(query=True)
322
  cl = GetClient()
324 323

  
325 324
  return GenericList(constants.QR_NODE, selected_fields, args, opts.units,
326 325
                     opts.separator, not opts.no_headers,
......
338 337
  @return: the desired exit code
339 338

  
340 339
  """
341
  cl = GetClient(query=True)
340
  cl = GetClient()
342 341

  
343 342
  return GenericListFields(constants.QR_NODE, args, opts.separator,
344 343
                           not opts.no_headers, cl=cl)
......
381 380

  
382 381
  cl = GetClient()
383 382

  
384
  qcl = GetClient(query=True)
383
  qcl = GetClient()
385 384
  result = qcl.QueryNodes(names=args, fields=fields, use_locking=False)
386 385
  qcl.Close()
387 386

  
......
440 439

  
441 440
  # these fields are static data anyway, so it doesn't matter, but
442 441
  # locking=True should be safer
443
  qcl = GetClient(query=True)
442
  qcl = GetClient()
444 443
  result = qcl.QueryNodes(names=args, fields=selected_fields,
445 444
                          use_locking=False)
446 445
  qcl.Close()
......
482 481
  force = opts.force
483 482
  selected_fields = ["name", "pinst_list"]
484 483

  
485
  qcl = GetClient(query=True)
484
  qcl = GetClient()
486 485
  result = qcl.QueryNodes(names=args, fields=selected_fields, use_locking=False)
487 486
  qcl.Close()
488 487
  ((node, pinst), ) = result
......
578 577
  @return: the desired exit code
579 578

  
580 579
  """
581
  cl = GetClient(query=True)
580
  cl = GetClient()
582 581
  result = cl.QueryNodes(fields=["name", "pip", "sip",
583 582
                                 "pinst_list", "sinst_list",
584 583
                                 "master_candidate", "drained", "offline",

Also available in: Unified diff