Commit 966e1580 authored by Helga Velroyen's avatar Helga Velroyen
Browse files

gnt-cluster info: report enabled disk templates



Add reporting of the currently enabled disk templates to
'gnt-cluster info'.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarMichele Tartara <mtarara@google.com>
parent 1b02d7ef
......@@ -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",
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment