Revision a3a5f850 lib/backend.py

b/lib/backend.py
476 476

  
477 477
  """
478 478
  result = {}
479
  my_name = utils.HostInfo().name
480
  port = utils.GetDaemonPort(constants.NODED)
479 481

  
480 482
  if constants.NV_HYPERVISOR in what:
481 483
    result[constants.NV_HYPERVISOR] = tmp = {}
......
500 502

  
501 503
  if constants.NV_NODENETTEST in what:
502 504
    result[constants.NV_NODENETTEST] = tmp = {}
503
    my_name = utils.HostInfo().name
504 505
    my_pip = my_sip = None
505 506
    for name, pip, sip in what[constants.NV_NODENETTEST]:
506 507
      if name == my_name:
......
511 512
      tmp[my_name] = ("Can't find my own primary/secondary IP"
512 513
                      " in the node list")
513 514
    else:
514
      port = utils.GetDaemonPort(constants.NODED)
515 515
      for name, pip, sip in what[constants.NV_NODENETTEST]:
516 516
        fail = []
517 517
        if not utils.TcpPing(pip, port, source=my_pip):
......
523 523
          tmp[name] = ("failure using the %s interface(s)" %
524 524
                       " and ".join(fail))
525 525

  
526
  if constants.NV_MASTERIP in what:
527
    # FIXME: add checks on incoming data structures (here and in the
528
    # rest of the function)
529
    master_name, master_ip = what[constants.NV_MASTERIP]
530
    if master_name == my_name:
531
      source = constants.LOCALHOST_IP_ADDRESS
532
    else:
533
      source = None
534
    result[constants.NV_MASTERIP] = utils.TcpPing(master_ip, port,
535
                                                  source=source)
536

  
526 537
  if constants.NV_LVLIST in what:
527 538
    try:
528 539
      val = GetVolumeList(what[constants.NV_LVLIST])

Also available in: Unified diff