diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py index e44f834423afbf1618c9165deeef1a8bb58d6419..52f98720ff985c5ac0ce3eb67c4098f7a80827f4 100644 --- a/lib/client/gnt_cluster.py +++ b/lib/client/gnt_cluster.py @@ -193,12 +193,20 @@ def InitCluster(opts, args): hv_state = dict(opts.hv_state) + # FIXME: remove enabled_storage_types when enabled_disk_templates are + # fully implemented. enabled_storage_types = opts.enabled_storage_types if enabled_storage_types is not None: enabled_storage_types = enabled_storage_types.split(",") else: enabled_storage_types = list(constants.DEFAULT_ENABLED_STORAGE_TYPES) + enabled_disk_templates = opts.enabled_disk_templates + if enabled_disk_templates: + enabled_disk_templates = enabled_disk_templates.split(",") + else: + enabled_disk_templates = list(constants.DEFAULT_ENABLED_DISK_TEMPLATES) + bootstrap.InitCluster(cluster_name=args[0], secondary_ip=opts.secondary_ip, vg_name=vg_name, @@ -459,6 +467,8 @@ def ShowClusterConfig(opts, args): utils.CommaJoin(pathutils.ES_SEARCH_PATH)), ("enabled storage types", utils.CommaJoin(result["enabled_storage_types"])), + ("enabled disk templates", + utils.CommaJoin(result["enabled_disk_templates"])), ]), ("Default node parameters", diff --git a/src/Ganeti/Query/Server.hs b/src/Ganeti/Query/Server.hs index 67298e9816a38ffc5e2c61f3380b0b2bf40bbe06..8184091dcd05a591efcad641a70cc71a0316df22 100644 --- a/src/Ganeti/Query/Server.hs +++ b/src/Ganeti/Query/Server.hs @@ -88,6 +88,7 @@ handleCall cdata QueryClusterInfo = let cluster = configCluster cdata hypervisors = clusterEnabledHypervisors cluster storageTypes = clusterEnabledStorageTypes cluster + diskTemplates = clusterEnabledDiskTemplates cluster def_hv = case hypervisors of x:_ -> showJSON x [] -> JSNull @@ -140,7 +141,10 @@ handleCall cdata QueryClusterInfo = showJSON $ clusterPreallocWipeDisks cluster) , ("hidden_os", showJSON $ clusterHiddenOs cluster) , ("blacklisted_os", showJSON $ clusterBlacklistedOs cluster) + -- FIXME: remove storage types once enabled disk templates are + -- fully implemented. , ("enabled_storage_types", showJSON storageTypes) + , ("enabled_disk_templates", showJSON diskTemplates) ] in return . Ok . J.makeObj $ obj