def get_libvirt_domain(connection, domain): try: return connection.lookupByName(domain) except libvirt.libvirtError: flask.abort(404)