Loading cloudcontrol/node/hypervisor/domains/__init__.py +9 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,15 @@ class VirtualMachine(object): #: UUID string of domain self.uuid = dom.UUIDString() self.name = dom.name() # Get title of VM try: self.title = dom.metadata(libvirt.VIR_DOMAIN_METADATA_TITLE, None) except (libvirt.libvirtError, AttributeError): # libvirtError handle the case where the title is not defined on the # vm, AttributeError handle the case where the libvirt is too old # to allow metadata handling self.title = None #: state of VM: started, stoped, paused self._state = STATE[dom.info()[0]] #: tags for this VM Loading cloudcontrol/node/hypervisor/domains/vm_tags.py +8 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,14 @@ def h(dom): return dom.name def t(dom): """Title of the VM (or name if title is not defined).""" if dom.title is None: return dom.name else: return dom.title @_vir_tag def cpu(dom): """Number of CPU of the VM.""" Loading Loading
cloudcontrol/node/hypervisor/domains/__init__.py +9 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,15 @@ class VirtualMachine(object): #: UUID string of domain self.uuid = dom.UUIDString() self.name = dom.name() # Get title of VM try: self.title = dom.metadata(libvirt.VIR_DOMAIN_METADATA_TITLE, None) except (libvirt.libvirtError, AttributeError): # libvirtError handle the case where the title is not defined on the # vm, AttributeError handle the case where the libvirt is too old # to allow metadata handling self.title = None #: state of VM: started, stoped, paused self._state = STATE[dom.info()[0]] #: tags for this VM Loading
cloudcontrol/node/hypervisor/domains/vm_tags.py +8 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,14 @@ def h(dom): return dom.name def t(dom): """Title of the VM (or name if title is not defined).""" if dom.title is None: return dom.name else: return dom.title @_vir_tag def cpu(dom): """Number of CPU of the VM.""" Loading