From e1b4fdf5dedfa67aaff8e4def9feb3af0af2fd58 Mon Sep 17 00:00:00 2001 From: Jan Krcmar Date: Tue, 23 Feb 2016 15:03:33 +0100 Subject: [PATCH] instances display virtual title under name --- instances/templates/instances.html | 2 +- vrtManager/connection.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/instances/templates/instances.html b/instances/templates/instances.html index b279d40..5e5c761 100644 --- a/instances/templates/instances.html +++ b/instances/templates/instances.html @@ -51,7 +51,7 @@ {% for host, inst in all_host_vms.items %} {% for vm, info in inst.items %} - {{ vm }} + {{ vm }}
{{ info.title }} {{ host.1 }} {% ifequal info.status 1 %} {% trans "Active" %} diff --git a/vrtManager/connection.py b/vrtManager/connection.py index fd9fb80..ee2f7e7 100644 --- a/vrtManager/connection.py +++ b/vrtManager/connection.py @@ -442,7 +442,16 @@ class wvmConnect(object): vcpu = cur_vcpu else: vcpu = util.get_xml_path(dom.XMLDesc(0), "/domain/vcpu") - vname[dom.name()] = {'status': dom.info()[0], 'uuid': dom.UUIDString(), 'vcpu': vcpu, 'memory': mem} + title = util.get_xml_path(dom.XMLDesc(0), "/domain/title") + description = util.get_xml_path(dom.XMLDesc(0), "/domain/description") + vname[dom.name()] = { + 'status': dom.info()[0], + 'uuid': dom.UUIDString(), + 'vcpu': vcpu, + 'memory': mem, + 'title': title if title else '', + 'description': description if description else '', + } return vname def get_user_instances(self, name):