Commit 469f88e1 authored by Iustin Pop's avatar Iustin Pop
Browse files

Show the cluster parametrs in gnt-cluster info

This is just a raw update without any special formatting.

Reviewed-by: imsnah
parent 2f7635f4
......@@ -1865,17 +1865,20 @@ class LUQueryClusterInfo(NoHooksLU):
"""Return cluster config.
"""
cluster = self.cfg.GetClusterInfo()
result = {
"name": self.cfg.GetClusterName(),
"software_version": constants.RELEASE_VERSION,
"protocol_version": constants.PROTOCOL_VERSION,
"config_version": constants.CONFIG_VERSION,
"os_api_version": constants.OS_API_VERSION,
"export_version": constants.EXPORT_VERSION,
"master": self.cfg.GetMasterNode(),
"architecture": (platform.architecture()[0], platform.machine()),
"hypervisor_type": self.cfg.GetHypervisorType(),
"enabled_hypervisors": self.cfg.GetClusterInfo().enabled_hypervisors,
"name": cluster.cluster_name,
"master": cluster.master_node,
"hypervisor_type": cluster.hypervisor,
"enabled_hypervisors": cluster.enabled_hypervisors,
"hvparams": cluster.hvparams,
"beparams": cluster.beparams,
}
return result
......
......@@ -145,7 +145,20 @@ def ShowClusterConfig(opts, args):
print ("Architecture (this node): %s (%s)" %
(result["architecture"][0], result["architecture"][1]))
print ("Cluster hypervisor: %s" % result["hypervisor_type"])
print ("Default hypervisor: %s" % result["hypervisor_type"])
print ("Enabled hypervisors: %s" % ", ".join(result["enabled_hypervisors"]))
print "Hypervisor parameters:"
for hv_name, hv_dict in result["hvparams"].items():
print " - %s:" % hv_name
for item, val in hv_dict.iteritems():
print " %s: %s" % (item, val)
print "Cluster parameters:"
for gr_name, gr_dict in result["beparams"].items():
print " - %s:" % gr_name
for item, val in gr_dict.iteritems():
print " %s: %s" % (item, val)
return 0
......
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