def metadata(self, xml_type, uri, flags): # we only support METADATA_ELEMENT assert xml_type == libvirt.VIR_DOMAIN_METADATA_ELEMENT xml_string = self.xml.get(uri, None) if xml_string is None: raise Error(libvirt.VIR_ERR_NO_DOMAIN_METADATA) return xml_string
def _failIfRequested(self): if self.virtError != libvirt.VIR_ERR_OK: raise Error(self.virtError, self._errorMessage)