MCPcopy Index your code
hub / github.com/retspen/webvirtcloud / get_user_instances

Method get_user_instances

vrtManager/connection.py:448–457  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

446 return vname
447
448 def get_user_instances(self, name):
449 dom = self.get_instance(name)
450 mem = util.get_xml_path(dom.XMLDesc(0), "/domain/currentMemory")
451 mem = int(mem) / 1024
452 cur_vcpu = util.get_xml_path(dom.XMLDesc(0), "/domain/vcpu/@current")
453 if cur_vcpu:
454 vcpu = cur_vcpu
455 else:
456 vcpu = util.get_xml_path(dom.XMLDesc(0), "/domain/vcpu")
457 return {'name': dom.name(), 'status': dom.info()[0], 'uuid': dom.UUIDString(), 'vcpu': vcpu, 'memory': mem}
458
459 def close(self):
460 """Close connection"""

Callers 1

instancesFunction · 0.80

Calls 1

get_instanceMethod · 0.95

Tested by

no test coverage detected