Commit 83d4ba5e authored by René Nussbaumer's avatar René Nussbaumer
Browse files

gnt-instance info: Rework beparams listings

This patch reworks the beparams listing to the new style. However, due
to this process the naming of the fields with mixed casing changed to
lowercase and is therefore not 100% compatible with the previous versions.

As "memory" is marked deprecated and sort of default we merge that just
into the actual dict, which leads to the following output:

  - maxmem: 128
  - memory: default (128)
  - minmem: 128

Instead of:

  - maxmem: 128
  - minmem: 128
  - memory: 128
Signed-off-by: default avatarRené Nussbaumer <>
Reviewed-by: default avatarIustin Pop <>
parent 15b5f9a4
......@@ -25,6 +25,7 @@
# W0614: Unused import %s from wildcard import (since we need cli)
# C0103: Invalid name gnt-instance
import copy
import itertools
import simplejson
import logging
......@@ -1249,23 +1250,12 @@ def ShowInstanceConfig(opts, args):
FormatParameterDict(buf, instance["hv_instance"], instance["hv_actual"],
buf.write(" Hardware:\n")
buf.write(" - VCPUs: %s\n" %
buf.write(" - maxmem: %sMiB\n" %
buf.write(" - minmem: %sMiB\n" %
# deprecated "memory" value, kept for one version for compatibility
# TODO(ganeti 2.7) remove.
buf.write(" - memory: %sMiB\n" %
buf.write(" - %s: %s\n" %
be_actual = copy.deepcopy(instance["be_actual"])
be_actual["memory"] = be_actual[constants.BE_MAXMEM]
FormatParameterDict(buf, instance["be_instance"], be_actual, level=2)
# TODO(ganeti 2.7) rework the NICs as well
buf.write(" - NICs:\n")
for idx, (ip, mac, mode, link) in enumerate(instance["nics"]):
buf.write(" - nic/%d: MAC: %s, IP: %s, mode: %s, link: %s\n" %
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