From 6546fa257074cba44319a207e3d95a910f1c83b5 Mon Sep 17 00:00:00 2001 From: Jan Krcmar Date: Thu, 24 Mar 2016 14:51:29 +0100 Subject: [PATCH] show instance title in instances view for non superuser --- instances/templates/instances.html | 2 +- vrtManager/connection.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/instances/templates/instances.html b/instances/templates/instances.html index f370e8c..df08f66 100644 --- a/instances/templates/instances.html +++ b/instances/templates/instances.html @@ -155,7 +155,7 @@ {% for inst, vm in all_user_vms.items %} - {{ vm.name }} + {{ vm.name }}
{{ vm.title }} {% ifequal vm.status 1 %} {% trans "Active" %} {% endifequal %} diff --git a/vrtManager/connection.py b/vrtManager/connection.py index ee2f7e7..c62c6e4 100644 --- a/vrtManager/connection.py +++ b/vrtManager/connection.py @@ -463,7 +463,17 @@ class wvmConnect(object): vcpu = cur_vcpu else: vcpu = util.get_xml_path(dom.XMLDesc(0), "/domain/vcpu") - return {'name': 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") + return { + 'name': dom.name(), + 'status': dom.info()[0], + 'uuid': dom.UUIDString(), + 'vcpu': vcpu, + 'memory': mem, + 'title': title if title else '', + 'description': description if description else '', + } def close(self): """Close connection"""