Commit 71aa8f73 authored by Iustin Pop's avatar Iustin Pop
Browse files

Make ‘gnt-instance info’ show kernel/initrd paths

This patch changes the info subcommand to nicely show the kernel and
initrd paths.

Reviewed-by: imsnah
parent 3b6d8c9b
......@@ -4054,6 +4054,8 @@ class LUQueryInstanceData(NoHooksLU):
"disks": disks,
"network_port": instance.network_port,
"vcpus": instance.vcpus,
"kernel_path": instance.kernel_path,
"initrd_path": instance.initrd_path,
}
result[instance.name] = idict
......
......@@ -626,6 +626,18 @@ def ShowInstanceConfig(opts, args):
buf.write(" - secondaries: %s\n" % ", ".join(instance["snodes"]))
buf.write(" Operating system: %s\n" % instance["os"])
buf.write(" Allocated network port: %s\n" % instance["network_port"])
if instance["kernel_path"] in (None, constants.VALUE_DEFAULT):
kpath = "(default: %s)" % constants.XEN_KERNEL
else:
kpath = instance["kernel_path"]
buf.write(" Kernel path: %s\n" % kpath)
if instance["initrd_path"] in (None, constants.VALUE_DEFAULT):
initrd = "(default: %s)" % constants.XEN_INITRD
elif instance["initrd_path"] == constants.VALUE_NONE:
initrd = "(none)"
else:
initrd = instance["initrd_path"]
buf.write(" initrd: %s\n" % initrd)
buf.write(" Hardware:\n")
buf.write(" - VCPUs: %d\n" % instance["vcpus"])
buf.write(" - memory: %dMiB\n" % instance["memory"])
......
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