From 3d9145853e6900aa31b57aa11ea41287ab64be44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Nussbaumer?= <rn@google.com>
Date: Tue, 12 Oct 2010 11:04:23 +0200
Subject: [PATCH] Add prealloc_wipe_disks as a cluster-wide configuration
 variable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is the first step for the support of wiping block devices prior
to creation of the instance.

Signed-off-by: RenΓ© Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/bootstrap.py | 3 ++-
 lib/objects.py   | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/bootstrap.py b/lib/bootstrap.py
index 889fa7118..4b454269c 100644
--- a/lib/bootstrap.py
+++ b/lib/bootstrap.py
@@ -227,7 +227,7 @@ def InitCluster(cluster_name, mac_prefix,
                 modify_etc_hosts=True, modify_ssh_setup=True,
                 maintain_node_health=False, drbd_helper=None,
                 uid_pool=None, default_iallocator=None,
-                primary_ip_version=None):
+                primary_ip_version=None, prealloc_wipe_disks=False):
   """Initialise the cluster.
 
   @type candidate_pool_size: int
@@ -394,6 +394,7 @@ def InitCluster(cluster_name, mac_prefix,
     drbd_usermode_helper=drbd_helper,
     default_iallocator=default_iallocator,
     primary_ip_family=ipcls.family,
+    prealloc_wipe_disks=prealloc_wipe_disks,
     )
   master_node_config = objects.Node(name=hostname.name,
                                     primary_ip=hostname.ip,
diff --git a/lib/objects.py b/lib/objects.py
index 612198a71..bf1b6bdd8 100644
--- a/lib/objects.py
+++ b/lib/objects.py
@@ -1006,6 +1006,7 @@ class Cluster(TaggableObject):
     "hidden_os",
     "blacklisted_os",
     "primary_ip_family",
+    "prealloc_wipe_disks",
     ] + _TIMESTAMPS + _UUID
 
   def UpgradeConfig(self):
@@ -1082,6 +1083,9 @@ class Cluster(TaggableObject):
     if self.primary_ip_family is None:
       self.primary_ip_family = AF_INET
 
+    if self.prealloc_wipe_disks is None:
+      self.prealloc_wipe_disks = False
+
   def ToDict(self):
     """Custom function for cluster.
 
-- 
GitLab