From d0de443e6fd5838ad1b0cc6f3c2b1e0ef12598e6 Mon Sep 17 00:00:00 2001
From: Helga Velroyen <helgav@google.com>
Date: Wed, 13 Mar 2013 14:44:20 +0100
Subject: [PATCH] Add 'enabled_storage_types' to the cluster config

This patch adds the cluster's new field 'enabled_storage_types'
to the configuration objects in python and haskell.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 lib/objects.py        | 1 +
 src/Ganeti/Objects.hs | 1 +
 src/Ganeti/Types.hs   | 5 +++++
 3 files changed, 7 insertions(+)

diff --git a/lib/objects.py b/lib/objects.py
index 51e13f883..2fdf7bce8 100644
--- a/lib/objects.py
+++ b/lib/objects.py
@@ -1474,6 +1474,7 @@ class Cluster(TaggableObject):
     "prealloc_wipe_disks",
     "hv_state_static",
     "disk_state_static",
+    "enabled_storage_types",
     ] + _TIMESTAMPS + _UUID
 
   def UpgradeConfig(self):
diff --git a/src/Ganeti/Objects.hs b/src/Ganeti/Objects.hs
index 6f2055c88..7e85cf1b3 100644
--- a/src/Ganeti/Objects.hs
+++ b/src/Ganeti/Objects.hs
@@ -681,6 +681,7 @@ $(buildObject "Cluster" "cluster" $
   , simpleField "primary_ip_family"       [t| IpFamily         |]
   , simpleField "prealloc_wipe_disks"     [t| Bool             |]
   , simpleField "ipolicy"                 [t| FilledIPolicy    |]
+  , simpleField "enabled_storage_types"   [t| [StorageType]    |]
  ]
  ++ timeStampFields
  ++ uuidFields
diff --git a/src/Ganeti/Types.hs b/src/Ganeti/Types.hs
index 1753ce682..810049a3c 100644
--- a/src/Ganeti/Types.hs
+++ b/src/Ganeti/Types.hs
@@ -302,6 +302,11 @@ $(THH.declareSADT "StorageType"
   [ ("StorageFile", 'C.stFile)
   , ("StorageLvmPv", 'C.stLvmPv)
   , ("StorageLvmVg", 'C.stLvmVg)
+  , ("StorageDiskless", 'C.stDiskless)
+  , ("StorageSharedFile", 'C.stSharedFile)
+  , ("StorageBlock", 'C.stBlock)
+  , ("StorageRados", 'C.stRados)
+  , ("StorageExt", 'C.stExt)
   ])
 $(THH.makeJSONInstance ''StorageType)
 
-- 
GitLab