Use libselinux-python instead of subprocess
This commit is contained in:
parent
37b7a23505
commit
4e8e1d4d90
15
bin/pungi
15
bin/pungi
@ -16,7 +16,7 @@ import os
|
||||
import pungi.gather
|
||||
import pungi.config
|
||||
import pungi.ks
|
||||
import subprocess
|
||||
import selinux
|
||||
|
||||
def main():
|
||||
|
||||
@ -30,15 +30,10 @@ def main():
|
||||
return 1
|
||||
|
||||
if opts.do_all or opts.do_buildinstall:
|
||||
try:
|
||||
selinux = subprocess.Popen('/usr/sbin/getenforce',
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=open('/dev/null', 'w')).communicate()[0].strip('\n')
|
||||
if selinux == 'Enforcing':
|
||||
print >> sys.stdout, "WARNING: SELinux is enforcing. This may lead to a compose with selinux disabled."
|
||||
print >> sys.stdout, "Consider running with setenforce 0."
|
||||
except:
|
||||
pass
|
||||
enforcing = selinux.security_getenforce()
|
||||
if enforcing:
|
||||
print >> sys.stdout, "WARNING: SELinux is enforcing. This may lead to a compose with selinux disabled."
|
||||
print >> sys.stdout, "Consider running with setenforce 0."
|
||||
|
||||
# Set up the kickstart parser and pass in the kickstart file we were handed
|
||||
ksparser = pungi.ks.get_ksparser(ks_path=opts.config)
|
||||
|
@ -15,6 +15,7 @@ Requires: python-lockfile
|
||||
Requires: kobo
|
||||
Requires: python-productmd
|
||||
Requires: python-kickstart
|
||||
Requires: libselinux-python
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user