Revision 1094acda

b/lib/cmdlib.py
2518 2518
      "hvparams": dict([(hypervisor, cluster.hvparams[hypervisor])
2519 2519
                        for hypervisor in cluster.enabled_hypervisors]),
2520 2520
      "beparams": cluster.beparams,
2521
      "nicparams": cluster.nicparams,
2521 2522
      "candidate_pool_size": cluster.candidate_pool_size,
2522 2523
      "default_bridge": cluster.default_bridge,
2523 2524
      "master_netdev": cluster.master_netdev,
b/scripts/gnt-cluster
209 209
  ToStdout(master)
210 210
  return 0
211 211

  
212
def _PrintGroupedParams(paramsdict):
213
  """Print Grouped parameters (be, nic, disk) by group.
214

  
215
  @type paramsdict: dict of dicts
216
  @param paramsdict: {group: {param: value, ...}, ...}
217

  
218
  """
219
  for gr_name, gr_dict in paramsdict.items():
220
    ToStdout("  - %s:", gr_name)
221
    for item, val in gr_dict.iteritems():
222
      ToStdout("      %s: %s", item, val)
212 223

  
213 224
def ShowClusterConfig(opts, args):
214 225
  """Shows cluster information.
......
234 245
  ToStdout("Enabled hypervisors: %s", ", ".join(result["enabled_hypervisors"]))
235 246

  
236 247
  ToStdout("Hypervisor parameters:")
237
  for hv_name, hv_dict in result["hvparams"].items():
238
    ToStdout("  - %s:", hv_name)
239
    for item, val in hv_dict.iteritems():
240
      ToStdout("      %s: %s", item, val)
248
  _PrintGroupedParams(result["hvparams"])
241 249

  
242 250
  ToStdout("Cluster parameters:")
243 251
  ToStdout("  - candidate pool size: %s", result["candidate_pool_size"])
......
247 255
  ToStdout("  - file storage path: %s", result["file_storage_dir"])
248 256

  
249 257
  ToStdout("Default instance parameters:")
250
  for gr_name, gr_dict in result["beparams"].items():
251
    ToStdout("  - %s:", gr_name)
252
    for item, val in gr_dict.iteritems():
253
      ToStdout("      %s: %s", item, val)
258
  _PrintGroupedParams(result["beparams"])
259

  
260
  ToStdout("Default nic parameters:")
261
  _PrintGroupedParams(result["nicparams"])
254 262

  
255 263
  return 0
256 264

  

Also available in: Unified diff