Commit 1094acda authored by Guido Trotter's avatar Guido Trotter
Browse files

Show nic parameters in cluster info


Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 5af3da74
...@@ -2518,6 +2518,7 @@ class LUQueryClusterInfo(NoHooksLU): ...@@ -2518,6 +2518,7 @@ class LUQueryClusterInfo(NoHooksLU):
"hvparams": dict([(hypervisor, cluster.hvparams[hypervisor]) "hvparams": dict([(hypervisor, cluster.hvparams[hypervisor])
for hypervisor in cluster.enabled_hypervisors]), for hypervisor in cluster.enabled_hypervisors]),
"beparams": cluster.beparams, "beparams": cluster.beparams,
"nicparams": cluster.nicparams,
"candidate_pool_size": cluster.candidate_pool_size, "candidate_pool_size": cluster.candidate_pool_size,
"default_bridge": cluster.default_bridge, "default_bridge": cluster.default_bridge,
"master_netdev": cluster.master_netdev, "master_netdev": cluster.master_netdev,
......
...@@ -209,6 +209,17 @@ def ShowClusterMaster(opts, args): ...@@ -209,6 +209,17 @@ def ShowClusterMaster(opts, args):
ToStdout(master) ToStdout(master)
return 0 return 0
def _PrintGroupedParams(paramsdict):
"""Print Grouped parameters (be, nic, disk) by group.
@type paramsdict: dict of dicts
@param paramsdict: {group: {param: value, ...}, ...}
"""
for gr_name, gr_dict in paramsdict.items():
ToStdout(" - %s:", gr_name)
for item, val in gr_dict.iteritems():
ToStdout(" %s: %s", item, val)
def ShowClusterConfig(opts, args): def ShowClusterConfig(opts, args):
"""Shows cluster information. """Shows cluster information.
...@@ -234,10 +245,7 @@ def ShowClusterConfig(opts, args): ...@@ -234,10 +245,7 @@ def ShowClusterConfig(opts, args):
ToStdout("Enabled hypervisors: %s", ", ".join(result["enabled_hypervisors"])) ToStdout("Enabled hypervisors: %s", ", ".join(result["enabled_hypervisors"]))
ToStdout("Hypervisor parameters:") ToStdout("Hypervisor parameters:")
for hv_name, hv_dict in result["hvparams"].items(): _PrintGroupedParams(result["hvparams"])
ToStdout(" - %s:", hv_name)
for item, val in hv_dict.iteritems():
ToStdout(" %s: %s", item, val)
ToStdout("Cluster parameters:") ToStdout("Cluster parameters:")
ToStdout(" - candidate pool size: %s", result["candidate_pool_size"]) ToStdout(" - candidate pool size: %s", result["candidate_pool_size"])
...@@ -247,10 +255,10 @@ def ShowClusterConfig(opts, args): ...@@ -247,10 +255,10 @@ def ShowClusterConfig(opts, args):
ToStdout(" - file storage path: %s", result["file_storage_dir"]) ToStdout(" - file storage path: %s", result["file_storage_dir"])
ToStdout("Default instance parameters:") ToStdout("Default instance parameters:")
for gr_name, gr_dict in result["beparams"].items(): _PrintGroupedParams(result["beparams"])
ToStdout(" - %s:", gr_name)
for item, val in gr_dict.iteritems(): ToStdout("Default nic parameters:")
ToStdout(" %s: %s", item, val) _PrintGroupedParams(result["nicparams"])
return 0 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