[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libvirt-users
Subject:    Re: python-libvirt domain.destroy() doesn't appear to be working for me
From:       Jeremy Markle <jeremy.markle () gmail ! com>
Date:       2020-08-24 15:08:39
Message-ID: CAH5+pVKE0bC+u=60+rbjSVZt6wb1W_cZGorj0rNqajuV5Pac5Q () mail ! gmail ! com
[Download RAW message or body]

I apologize... the bits I saw the "< 0" testing were in the following link.
The examples in the repo don't have either try/catch or the int testing
such as in the second link.

https://libvirt.org/docs/libvirt-appdev-guide-python/en-US/html/libvirt_application_de \
velopment_guide_using_python-Guest_Domains-Lifecycle_Control.html#libvirt_application_development_guide_using_python-Guest_Domains-Lifecycle-Provisioning_and_Starting


https://gitlab.com/libvirt/libvirt-python/-/blob/d8d55b17e227f0ce829e709966f580861186f8ab/examples/domsave.py#L29



On Mon, Aug 24, 2020 at 6:09 AM Michal Privoznik <mprivozn@redhat.com>
wrote:

> On 8/24/20 11:38 AM, Jeremy Markle wrote:
> > 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.
> > 
> 
> Can you be more specific please? A quick git grep shows only a few cases
> which don't compare APIs rather than some integer variables:
> 
> libvirt-python.git $ git grep -C 3 -e '< 0' --or -e '== 0' -- examples/
> 
> And those try/catch statements - in our basic examples we don't do any
> rollback and simply just let python abort.
> 
> Michal
> 
> 


[Attachment #3 (text/html)]

<div dir="ltr"><div>I apologize... the bits I saw the &quot;&lt; 0&quot; testing were \
in the following link. The examples in the repo don&#39;t have either try/catch or \
the int testing such as in the second link.</div><div><br></div><a \
href="https://libvirt.org/docs/libvirt-appdev-guide-python/en-US/html/libvirt_applicat \
ion_development_guide_using_python-Guest_Domains-Lifecycle_Control.html#libvirt_applic \
ation_development_guide_using_python-Guest_Domains-Lifecycle-Provisioning_and_Starting \
">https://libvirt.org/docs/libvirt-appdev-guide-python/en-US/html/libvirt_application_ \
development_guide_using_python-Guest_Domains-Lifecycle_Control.html#libvirt_applicatio \
n_development_guide_using_python-Guest_Domains-Lifecycle-Provisioning_and_Starting</a><br><div><br></div><div><a \
href="https://gitlab.com/libvirt/libvirt-python/-/blob/d8d55b17e227f0ce829e709966f5808 \
61186f8ab/examples/domsave.py#L29">https://gitlab.com/libvirt/libvirt-python/-/blob/d8 \
d55b17e227f0ce829e709966f580861186f8ab/examples/domsave.py#L29</a><br></div><div><br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 24, 2020 at 6:09 AM \
Michal Privoznik &lt;<a href="mailto:mprivozn@redhat.com">mprivozn@redhat.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 8/24/20 11:38 AM, \
Jeremy Markle wrote:<br> &gt; I was simply following the examples in the \
python-libvirt repo. If those <br> &gt; methods raise exceptions I&#39;ll definitely \
change to try/catch. Thank you. <br> &gt; The maintainer of the repo should update \
the examples and documentation <br> &gt; if exceptions are raised by those.<br>
&gt; <br>
<br>
Can you be more specific please? A quick git grep shows only a few cases <br>
which don&#39;t compare APIs rather than some integer variables:<br>
<br>
libvirt-python.git $ git grep -C 3 -e &#39;&lt; 0&#39; --or -e &#39;== 0&#39; -- \
examples/<br> <br>
And those try/catch statements - in our basic examples we don&#39;t do any <br>
rollback and simply just let python abort.<br>
<br>
Michal<br>
<br>
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic