python-libvirt domain.destroy() doesn't appear to be working for me

Jeremy Markle jeremy.markle at gmail.com
Mon Aug 24 09:38:37 UTC 2020


I was simply following the examples in the python-libvirt repo. If those
methods raise exceptions I'll definitely change to try/catch. Thank you.
The maintainer of the repo should update the examples and documentation if
exceptions are raised by those.

On Mon, Aug 24, 2020, 05:31 Daniel P. Berrangé <berrange at redhat.com> wrote:

> On Sat, Aug 22, 2020 at 10:32:09AM -0400, Jeremy Markle wrote:
> > I'm using the python-libvirt library and finding that I cannot get
> > .destroy() or .shutdown() to work.
> >
> >
> https://github.com/simora/docker-libvirt-flask/blob/cba6041b47bdf4ccb3b9506a0379cf8c788a9a57/root/app/mqtt.py#L96
>
> Your code has alot of "< 0" checks. This is the C API behaviour to return
> -1
> on error.  In python we raise exceptions on error. so you try try/except to
> catch them
>
> Daniel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20200824/ad264241/attachment.htm>


More information about the libvirt-users mailing list