Merge branch 'stable-2.9' into stable-2.10
[ganeti-local] / lib / objects.py
index 5b0fd57..aca6c66 100644 (file)
@@ -1598,9 +1598,13 @@ class Cluster(TaggableObject):
     if self.hvparams is None:
       self.hvparams = constants.HVC_DEFAULTS
     else:
-      for hypervisor in self.hvparams:
+      for hypervisor in constants.HYPER_TYPES:
+        try:
+          existing_params = self.hvparams[hypervisor]
+        except KeyError:
+          existing_params = {}
         self.hvparams[hypervisor] = FillDict(
-            constants.HVC_DEFAULTS[hypervisor], self.hvparams[hypervisor])
+            constants.HVC_DEFAULTS[hypervisor], existing_params)
 
     if self.os_hvp is None:
       self.os_hvp = {}