Revision 2a6469d5 lib/cmdlib.py

b/lib/cmdlib.py
499 499
    if config.ConfigWriter.IsCluster():
500 500
      raise errors.OpPrereqError("Cluster is already initialised")
501 501

  
502
    if self.op.hypervisor_type == constants.HT_XEN_HVM31:
503
      if not os.path.exists(constants.VNC_PASSWORD_FILE):
504
        raise errors.OpPrereqError("Please prepare the cluster VNC"
505
                                   "password file %s" %
506
                                   constants.VNC_PASSWORD_FILE)
507

  
502 508
    self.hostname = hostname = utils.HostInfo()
503 509

  
504 510
    if hostname.ip.startswith("127."):
......
1470 1476
                                 primary_ip=primary_ip,
1471 1477
                                 secondary_ip=secondary_ip)
1472 1478

  
1479
    if self.sstore.GetHypervisorType() == constants.HT_XEN_HVM31:
1480
      if not os.path.exists(constants.VNC_PASSWORD_FILE):
1481
        raise errors.OpPrereqError("Cluster VNC password file %s missing" %
1482
                                   constants.VNC_PASSWORD_FILE)
1483

  
1473 1484
  def Exec(self, feedback_fn):
1474 1485
    """Adds the new node to the cluster.
1475 1486

  
......
1589 1600
                       (fname, to_node))
1590 1601

  
1591 1602
    to_copy = ss.GetFileList()
1603
    if self.sstore.GetHypervisorType() == constants.HT_XEN_HVM31:
1604
      to_copy.append(constants.VNC_PASSWORD_FILE)
1592 1605
    for fname in to_copy:
1593 1606
      if not ssh.CopyFileToNode(node, fname):
1594 1607
        logger.Error("could not copy file %s to node %s" % (fname, node))
......
3028 3041
    if self.inst_ip is not None:
3029 3042
      nic.ip = self.inst_ip
3030 3043

  
3031
    network_port = None  # placeholder assignment for later
3044
    ht_kind = self.sstore.GetHypervisorType()
3045
    if ht_kind in constants.HTS_REQ_PORT:
3046
      network_port = self.cfg.AllocatePort()
3047
    else:
3048
      network_port = None
3032 3049

  
3033 3050
    disks = _GenerateDiskTemplate(self.cfg,
3034 3051
                                  self.op.disk_template,

Also available in: Unified diff