gnt-cluster info: show enabled storage types
authorHelga Velroyen <helgav@google.com>
Wed, 13 Mar 2013 14:38:17 +0000 (15:38 +0100)
committerHelga Velroyen <helgav@google.com>
Thu, 21 Mar 2013 15:41:04 +0000 (16:41 +0100)
This extends the 'gnt-cluster info' command to list the storage types
that are enabled on the cluster. It also fixes the broken indentation
in the 'handleCall' function.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

lib/client/gnt_cluster.py
src/Ganeti/Query/Server.hs

index 77d8a6f..f87a274 100644 (file)
@@ -454,6 +454,8 @@ def ShowClusterConfig(opts, args):
   ToStdout("  - OS search path: %s", utils.CommaJoin(pathutils.OS_SEARCH_PATH))
   ToStdout("  - ExtStorage Providers search path: %s",
            utils.CommaJoin(pathutils.ES_SEARCH_PATH))
+  ToStdout("  - enabled storage types: %s",
+           utils.CommaJoin(result["enabled_storage_types"]))
 
   ToStdout("Default node parameters:")
   _PrintGroupedParams(result["ndparams"], roman=opts.roman_integers)
index df0e11c..67298e9 100644 (file)
@@ -87,6 +87,7 @@ handleCall :: ConfigData -> LuxiOp -> IO (ErrorResult JSValue)
 handleCall cdata QueryClusterInfo =
   let cluster = configCluster cdata
       hypervisors = clusterEnabledHypervisors cluster
+      storageTypes = clusterEnabledStorageTypes cluster
       def_hv = case hypervisors of
                  x:_ -> showJSON x
                  [] -> JSNull
@@ -135,10 +136,11 @@ handleCall cdata QueryClusterInfo =
             , ("reserved_lvs", showJSON $ clusterReservedLvs cluster)
             , ("primary_ip_version",
                showJSON . ipFamilyToVersion $ clusterPrimaryIpFamily cluster)
-             , ("prealloc_wipe_disks",
-                showJSON $ clusterPreallocWipeDisks cluster)
-             , ("hidden_os", showJSON $ clusterHiddenOs cluster)
-             , ("blacklisted_os", showJSON $ clusterBlacklistedOs cluster)
+            , ("prealloc_wipe_disks",
+               showJSON $ clusterPreallocWipeDisks cluster)
+            , ("hidden_os", showJSON $ clusterHiddenOs cluster)
+            , ("blacklisted_os", showJSON $ clusterBlacklistedOs cluster)
+            , ("enabled_storage_types", showJSON storageTypes)
             ]
 
   in return . Ok . J.makeObj $ obj