Commit 34b6ab97 authored by Alexander Schreiber's avatar Alexander Schreiber
Browse files

merge r1539 from branches/ganeti/ganeti-1.2

Display VNC console port in gnt-instance info.


Reviewed-by: iustinp
parent 5bc84f33
......@@ -4147,6 +4147,15 @@ class LUQueryInstanceData(NoHooksLU):
idict["hvm_disk_type"] = instance.hvm_disk_type
if htkind in constants.HTS_REQ_PORT:
if instance.network_port is None:
vnc_console_port = None
elif instance.vnc_bind_address == constants.BIND_ADDRESS_GLOBAL:
vnc_console_port = "%s:%s"% (instance.primary_node,
instance.network_port)
else:
vnc_console_port = "%s:%s" % (instance.vnc_bind_address,
instance.network_port)
idict["vnc_console_port"] = vnc_console_port
idict["vnc_bind_address"] = instance.vnc_bind_address
idict["network_port"] = instance.network_port
......
......@@ -689,6 +689,7 @@ def ShowInstanceConfig(opts, args):
buf.write(" - virtual disk type: %s\n" % instance["hvm_disk_type"])
if instance.has_key("vnc_bind_address"):
buf.write(" VNC bind address: %s\n" % instance["vnc_bind_address"])
buf.write(" VNC console port: %s\n" % instance["vnc_console_port"])
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