Revision bc57fa8d lib/client/gnt_cluster.py

b/lib/client/gnt_cluster.py
570 570
                               errors.ECODE_INVAL)
571 571

  
572 572
  cl = GetClient()
573
  qcl = GetClient(query=True)
573 574
  try:
574 575
    cluster_name = cl.QueryConfigValues(["cluster_name"])[0]
575 576

  
576
    results = GetOnlineNodes(nodes=opts.nodes, cl=cl, filter_master=True,
577
    results = GetOnlineNodes(nodes=opts.nodes, cl=qcl, filter_master=True,
577 578
                             secondary_ips=opts.use_replication_network,
578 579
                             nodegroup=opts.nodegroup)
579
    ports = GetNodesSshPorts(opts.nodes, cl)
580
    ports = GetNodesSshPorts(opts.nodes, qcl)
580 581
  finally:
581 582
    cl.Close()
583
    qcl.Close()
582 584

  
583 585
  srun = ssh.SshRunner(cluster_name)
584 586
  for (node, port) in zip(results, ports):
......
599 601

  
600 602
  """
601 603
  cl = GetClient()
604
  qcl = GetClient(query=True)
602 605

  
603 606
  command = " ".join(args)
604 607

  
605
  nodes = GetOnlineNodes(nodes=opts.nodes, cl=cl, nodegroup=opts.nodegroup)
606
  ports = GetNodesSshPorts(nodes, cl)
608
  nodes = GetOnlineNodes(nodes=opts.nodes, cl=qcl, nodegroup=opts.nodegroup)
609
  ports = GetNodesSshPorts(nodes, qcl)
607 610

  
608 611
  cluster_name, master_node = cl.QueryConfigValues(["cluster_name",
609 612
                                                    "master_node"])
......
1520 1523
    return constants.EXIT_FAILURE
1521 1524

  
1522 1525

  
1523
def Epo(opts, args, cl=None, _on_fn=_EpoOn, _off_fn=_EpoOff,
1526
def Epo(opts, args, cl=None, qcl=None, _on_fn=_EpoOn, _off_fn=_EpoOff,
1524 1527
        _confirm_fn=ConfirmOperation,
1525 1528
        _stdout_fn=ToStdout, _stderr_fn=ToStderr):
1526 1529
  """EPO operations.
......
1541 1544

  
1542 1545
  if cl is None:
1543 1546
    cl = GetClient()
1547
  if qcl is None:
1548
    # Query client
1549
    qcl = GetClient(query=True)
1544 1550

  
1545 1551
  if opts.groups:
1546 1552
    node_query_list = \
......
1548 1554
  else:
1549 1555
    node_query_list = args
1550 1556

  
1551
  result = cl.QueryNodes(node_query_list, ["name", "master", "pinst_list",
1552
                                           "sinst_list", "powered", "offline"],
1553
                         False)
1557
  result = qcl.QueryNodes(node_query_list, ["name", "master", "pinst_list",
1558
                                            "sinst_list", "powered", "offline"],
1559
                          False)
1554 1560

  
1555 1561
  all_nodes = map(compat.fst, result)
1556 1562
  node_list = []

Also available in: Unified diff