Revision a744b676 lib/backend.py

b/lib/backend.py
58 58
from ganeti import objects
59 59
from ganeti import ssconf
60 60
from ganeti import serializer
61
from ganeti import netutils
61 62

  
62 63

  
63 64
_BOOT_ID_PATH = "/proc/sys/kernel/random/boot_id"
......
258 259
  master_netdev, master_ip, _ = GetMasterInfo()
259 260

  
260 261
  err_msgs = []
261
  if utils.TcpPing(master_ip, constants.DEFAULT_NODED_PORT):
262
    if utils.OwnIpAddress(master_ip):
262
  if netutils.TcpPing(master_ip, constants.DEFAULT_NODED_PORT):
263
    if netutils.OwnIpAddress(master_ip):
263 264
      # we already have the ip:
264 265
      logging.debug("Master IP already configured, doing nothing")
265 266
    else:
......
487 488

  
488 489
  """
489 490
  result = {}
490
  my_name = utils.HostInfo().name
491
  port = utils.GetDaemonPort(constants.NODED)
491
  my_name = netutils.HostInfo().name
492
  port = netutils.GetDaemonPort(constants.NODED)
492 493

  
493 494
  if constants.NV_HYPERVISOR in what:
494 495
    result[constants.NV_HYPERVISOR] = tmp = {}
......
525 526
    else:
526 527
      for name, pip, sip in what[constants.NV_NODENETTEST]:
527 528
        fail = []
528
        if not utils.TcpPing(pip, port, source=my_pip):
529
        if not netutils.TcpPing(pip, port, source=my_pip):
529 530
          fail.append("primary")
530 531
        if sip != pip:
531
          if not utils.TcpPing(sip, port, source=my_sip):
532
          if not netutils.TcpPing(sip, port, source=my_sip):
532 533
            fail.append("secondary")
533 534
        if fail:
534 535
          tmp[name] = ("failure using the %s interface(s)" %
......
542 543
      source = constants.IP4_ADDRESS_LOCALHOST
543 544
    else:
544 545
      source = None
545
    result[constants.NV_MASTERIP] = utils.TcpPing(master_ip, port,
546
    result[constants.NV_MASTERIP] = netutils.TcpPing(master_ip, port,
546 547
                                                  source=source)
547 548

  
548 549
  if constants.NV_LVLIST in what:
......
2591 2592

  
2592 2593
  """
2593 2594
  (key_pem, cert_pem) = \
2594
    utils.GenerateSelfSignedX509Cert(utils.HostInfo.SysName(),
2595
    utils.GenerateSelfSignedX509Cert(netutils.HostInfo.SysName(),
2595 2596
                                     min(validity, _MAX_SSL_CERT_VALIDITY))
2596 2597

  
2597 2598
  cert_dir = tempfile.mkdtemp(dir=cryptodir,
......
2934 2935

  
2935 2936
  """
2936 2937
  # set the correct physical ID
2937
  my_name = utils.HostInfo().name
2938
  my_name = netutils.HostInfo().name
2938 2939
  for cf in disks:
2939 2940
    cf.SetPhysicalID(my_name, nodes_ip)
2940 2941

  

Also available in: Unified diff