Re: [PATCH python] Fix error check for virDomainGetTime method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/24/2017 04:15 PM, Daniel P. Berrange wrote:
> The virDomainGetTime returns either a dict or None, but the python
> glue layer for checking for '-1'. Thus it failed to raise an
> exception on error.
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  libvirt-override-virDomain.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libvirt-override-virDomain.py b/libvirt-override-virDomain.py
> index fa5f75f..7c417b8 100644
> --- a/libvirt-override-virDomain.py
> +++ b/libvirt-override-virDomain.py
> @@ -63,7 +63,7 @@
>      def getTime(self, flags=0):
>          """Extract information about guest time """
>          ret = libvirtmod.virDomainGetTime(self._o, flags)
> -        if ret == -1: raise libvirtError ('virDomainGetTime() failed', dom=self)
> +        if ret == None: raise libvirtError ('virDomainGetTime() failed', dom=self)
>          return ret
>  
>      def setTime(self, time=None, flags=0):
> 

ACK, trivial.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux