[Kimchi-devel] [PATCH 2/2] Change getsebool to run silently.
Ramon Medeiros
ramonn at linux.vnet.ibm.com
Thu Jul 23 13:57:27 UTC 2015
Reviewed-By: Ramon Medeiros <ramonn at br.ibm.com>
On 07/23/2015 10:56 AM, Jose Ricardo Ziviani wrote:
> - getsebool virt_use_sysfs exists in RHEL6 and older distributions
> only. Newer distros don't have it but run_command alerts there is an
> error in Kimchi. This is not an error but a expected behavior. For
> this reason, this command now will only log for debugging purposes.
>
> Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
> ---
> src/kimchi/model/vmhostdevs.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/kimchi/model/vmhostdevs.py b/src/kimchi/model/vmhostdevs.py
> index 3e711cb..9a7d03b 100644
> --- a/src/kimchi/model/vmhostdevs.py
> +++ b/src/kimchi/model/vmhostdevs.py
> @@ -102,7 +102,8 @@ class VMHostDevsModel(object):
>
> # Enable virt_use_sysfs on RHEL6 and older distributions
> # In recent Fedora, there is no virt_use_sysfs.
> - out, err, rc = run_command(['getsebool', 'virt_use_sysfs'])
> + out, err, rc = run_command(['getsebool', 'virt_use_sysfs'],
> + silent=True)
> if rc == 0 and out.rstrip('\n') != "virt_use_sysfs --> on":
> out, err, rc = run_command(['setsebool', '-P',
> 'virt_use_sysfs=on'])
--
Ramon Nunes Medeiros
Kimchi Developer
Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn at br.ibm.com
More information about the Kimchi-devel
mailing list