Commit 0b13832c authored by Guido Trotter's avatar Guido Trotter
Browse files

Fix QueryInstanceData for nic parameters



This CL updates QueryInstanceData to return NICs in the new format (mac,
ip, mode, link) and fixes gnt-instance info to properly display them.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 638c6349
......@@ -5830,7 +5830,8 @@ class LUQueryInstanceData(NoHooksLU):
"pnode": instance.primary_node,
"snodes": instance.secondary_nodes,
"os": instance.os,
"nics": [(nic.mac, nic.ip, nic.bridge) for nic in instance.nics],
# this happens to be the same format used for hooks
"nics": _NICListToTuple(self, instance.nics),
"disks": disks,
"hypervisor": instance.hypervisor,
"network_port": instance.network_port,
......
......@@ -1158,9 +1158,9 @@ def ShowInstanceConfig(opts, args):
buf.write(" - memory: %dMiB\n" %
instance["be_actual"][constants.BE_MEMORY])
buf.write(" - NICs:\n")
for idx, (mac, ip, bridge) in enumerate(instance["nics"]):
buf.write(" - nic/%d: MAC: %s, IP: %s, bridge: %s\n" %
(idx, mac, ip, bridge))
for idx, (mac, ip, mode, link) in enumerate(instance["nics"]):
buf.write(" - nic/%d: MAC: %s, IP: %s, mode: %s, link: %s\n" %
(idx, mac, ip, mode, link))
buf.write(" Disks:\n")
for idx, device in enumerate(instance["disks"]):
......@@ -1388,7 +1388,7 @@ commands = {
"Lists the instances and their status. The available fields are"
" (see the man page for details): status, oper_state, oper_ram,"
" name, os, pnode, snodes, admin_state, admin_ram, disk_template,"
" ip, mac, bridge, sda_size, sdb_size, vcpus, serial_no,"
" ip, mac, mode, link, sda_size, sdb_size, vcpus, serial_no,"
" hypervisor."
" The default field"
" list is (in order): %s." % ", ".join(_LIST_DEF_FIELDS),
......
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