Add ParseCpuMask() utility function
[ganeti-local] / lib / objects.py
index 9e9163c..be6f2d7 100644 (file)
@@ -364,6 +364,12 @@ class ConfigData(ConfigObject):
       node.UpgradeConfig()
     for instance in self.instances.values():
       instance.UpgradeConfig()
+    if self.cluster.drbd_usermode_helper is None:
+      # To decide if we set an helper let's check if at least one instance has
+      # a DRBD disk. This does not cover all the possible scenarios but it
+      # gives a good approximation.
+      if self.HasAnyDiskOfType(constants.LD_DRBD8):
+        self.cluster.drbd_usermode_helper = constants.DEFAULT_DRBD_HELPER
 
 
 class NIC(ConfigObject):
@@ -911,6 +917,7 @@ class Cluster(TaggableObject):
     "modify_ssh_setup",
     "maintain_node_health",
     "uid_pool",
+    "default_iallocator",
     ] + _TIMESTAMPS + _UUID
 
   def UpgradeConfig(self):
@@ -969,6 +976,9 @@ class Cluster(TaggableObject):
     if self.uid_pool is None:
       self.uid_pool = []
 
+    if self.default_iallocator is None:
+      self.default_iallocator = ""
+
   def ToDict(self):
     """Custom function for cluster.