[Kimchi-devel] [PATCH] [Kimchi] Fix checking for libvirt daemon on Ubuntu

Ramon Medeiros ramonn at linux.vnet.ibm.com
Tue Dec 6 18:24:14 UTC 2016


All systems uses libvirtd as service and systemctl? If true:

Reviewed-By: Ramon Medeiros <ramonn at br.ibm.com>


On 12/06/2016 04:20 PM, Lucio Correia wrote:
> Starting with Ubuntu 16.10, it also comes with libvirtd and
> differentiate it from other distros is not necessary anymore.
>
> It also fixes an issue on libvirt service status verification
> causing failure on Kimchi plugin loading:
>
> dev at u1610:$ systemctl is-active libvirt-bin.service
> inactive
> dev at u1610:$ systemctl is-active libvirtd.service
> active
>
> Signed-off-by: Lucio Correia <luciojhc at linux.vnet.ibm.com>
> ---
>   utils.py | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/utils.py b/utils.py
> index 26d3cf6..1e2c951 100644
> --- a/utils.py
> +++ b/utils.py
> @@ -20,7 +20,6 @@
>
>   import contextlib
>   import json
> -import platform
>   import re
>   import sqlite3
>   import time
> @@ -264,11 +263,6 @@ def is_libvirtd_up():
>       """
>       Checks if libvirtd.service is up.
>       """
> -    distro, _, _ = platform.linux_distribution()
> -    if distro.lower() == 'ubuntu':
> -        cmd = ['systemctl', 'is-active', 'libvirt-bin.service']
> -    else:
> -        cmd = ['systemctl', 'is-active', 'libvirtd.service']
> -
> +    cmd = ['systemctl', 'is-active', 'libvirtd.service']
>       output, error, rc = run_command(cmd, silent=True)
>       return True if output == 'active\n' else False

-- 

Ramon Nunes Medeiros
Kimchi Developer
Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn at br.ibm.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/kimchi-devel/attachments/20161206/f7ba625f/attachment.html>


More information about the Kimchi-devel mailing list