wrap check for selinux enforcing in a try except

Signed-off-by: Dennis Gilmore <dennis@ausil.us>
This commit is contained in:
Dennis Gilmore 2015-06-11 22:04:35 -05:00
parent e8f4b7334e
commit 11a80ddbda

View File

@ -30,7 +30,11 @@ def main():
return 1 return 1
if opts.do_all or opts.do_buildinstall: if opts.do_all or opts.do_buildinstall:
enforcing = selinux.security_getenforce() try:
enforcing = selinux.security_getenforce()
except:
print >> sys.stdout, "INFO: selinux disabled"
enforcing = False
if enforcing: if enforcing:
print >> sys.stdout, "WARNING: SELinux is enforcing. This may lead to a compose with selinux disabled." print >> sys.stdout, "WARNING: SELinux is enforcing. This may lead to a compose with selinux disabled."
print >> sys.stdout, "Consider running with setenforce 0." print >> sys.stdout, "Consider running with setenforce 0."