1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 11:16:47 +00:00

chore(vrtManager): remove the unused get_user_instances

Nothing calls it: a per-VM reader of name, state, memory, vCPUs and
title, which the VM lists now read with get_domain_rows.
This commit is contained in:
catborise 2026-11-04 21:43:33 +03:00
parent 4dd72766cf
commit c9fe077fe8

View file

@ -1225,35 +1225,6 @@ class wvmConnect(object):
for dev in self.wvm.listAllDevices(libvirt.VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET)
]
def get_user_instances(self, name):
dom = self.get_instance(name)
xml = dom.XMLDesc(0)
def get_info(ctx):
mem = util.get_xpath(ctx, "/domain/currentMemory")
mem = int(mem) // 1024
cur_vcpu = util.get_xpath(ctx, "/domain/vcpu/@current")
if cur_vcpu:
vcpu = cur_vcpu
else:
vcpu = util.get_xpath(ctx, "/domain/vcpu")
title = util.get_xpath(ctx, "/domain/title")
title = title if title else ""
description = util.get_xpath(ctx, "/domain/description")
description = description if description else ""
return mem, vcpu, title, description
(mem, vcpu, title, description) = util.get_xml_path(xml, func=get_info)
return {
"name": dom.name(),
"status": dom.info()[0],
"uuid": dom.UUIDString(),
"vcpu": vcpu,
"memory": mem,
"title": title,
"description": description,
}
def close(self):
"""Close connection"""
# to-do: do not close connection ;)