LUAddNode: copy the vnc password file also for KVM
authorGuido Trotter <ultrotter@google.com>
Thu, 29 Jan 2009 15:51:14 +0000 (15:51 +0000)
committerGuido Trotter <ultrotter@google.com>
Thu, 29 Jan 2009 15:51:14 +0000 (15:51 +0000)
Before we used to copy the file if xen-hvm was enabled on the cluster,
no we'll do that if any enabled hypervisor is in the new HTS_USE_VNC
group.

Reviewed-by: iustinp

lib/cmdlib.py
lib/constants.py

index 9db397b..d7f883b 100644 (file)
@@ -2178,8 +2178,10 @@ class LUAddNode(LogicalUnit):
           logging.error("Copy of file %s to node %s failed", fname, to_node)
 
     to_copy = []
-    if constants.HT_XEN_HVM in self.cfg.GetClusterInfo().enabled_hypervisors:
+    enabled_hypervisors = self.cfg.GetClusterInfo().enabled_hypervisors
+    if constants.HTS_USE_VNC.intersection(enabled_hypervisors):
       to_copy.append(constants.VNC_PASSWORD_FILE)
+
     for fname in to_copy:
       result = self.rpc.call_upload_file([node], fname)
       if result[node].failed or not result[node]:
index 2c60301..2e0b8d9 100644 (file)
@@ -325,6 +325,7 @@ HT_XEN_HVM = "xen-hvm"
 HT_KVM = "kvm"
 HYPER_TYPES = frozenset([HT_XEN_PVM, HT_FAKE, HT_XEN_HVM, HT_KVM])
 HTS_REQ_PORT = frozenset([HT_XEN_HVM, HT_KVM])
+HTS_USE_VNC = frozenset([HT_XEN_HVM, HT_KVM])
 
 HT_HVM_VNC_BASE_PORT = 5900
 HT_HVM_DEFAULT_BOOT_ORDER = 'dc'