From f18ab34b36946a181de617cbdd16e0da003edc32 Mon Sep 17 00:00:00 2001 From: savichev Date: Tue, 8 Sep 2015 15:54:00 +0500 Subject: [PATCH] dependency for #50 dependency for https://github.com/retspen/webvirtcloud/pull/50 --- vrtManager/instance.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/vrtManager/instance.py b/vrtManager/instance.py index 2cb312e..4218aa4 100644 --- a/vrtManager/instance.py +++ b/vrtManager/instance.py @@ -81,6 +81,43 @@ class wvmInstances(wvmConnect): dom = self.get_instance(name) xml = dom.XMLDesc(VIR_DOMAIN_XML_SECURE) self.wvm.defineXML(xml) + + def graphics_type(self, name): + inst = self.get_instance(name) + console_type = util.get_xml_path(inst.XMLDesc(0), "/domain/devices/graphics/@type") + if console_type is None: + return "None" + return console_type + + def graphics_listen(self, name): + inst = self.get_instance(name) + listen_addr = util.get_xml_path(inst.XMLDesc(0), "/domain/devices/graphics/@listen") + if listen_addr is None: + listen_addr = util.get_xml_path(inst.XMLDesc(0), "/domain/devices/graphics/listen/@address") + if listen_addr is None: + return "None" + return listen_addr + + def graphics_port(self, name): + inst = self.get_instance(name) + console_port = util.get_xml_path(inst.XMLDesc(0), "/domain/devices/graphics/@port") + if console_port is None: + return "None" + return console_port + + def domain_name(self, name): + inst = self.get_instance(name) + domname = util.get_xml_path(inst.XMLDesc(0), "/domain/name") + if domname is None: + return "NoName" + return domname + + def graphics_passwd(self, name): + inst = self.get_instance(name) + password = util.get_xml_path(inst.XMLDesc(VIR_DOMAIN_XML_SECURE), "/domain/devices/graphics/@passwd") + if password is None: + return "None" + return password class wvmInstance(wvmConnect):