platform_external_selinux/python
Nicolas Iooss 8f0ea463bc sepolicy: do not fail when file_contexts.local or .subs do not exist
On a system without any file context customizations, "sepolicy gui"
fails to load because it tries to read a non-existing file:

    FileNotFoundError: [Errno 2] No such file or directory:
    '/etc/selinux/refpolicy-git/contexts/files/file_contexts.local'

Once this issue is fixed, another one is triggered:

    FileNotFoundError: [Errno 2] No such file or directory:
    '/etc/selinux/refpolicy-git/contexts/files/file_contexts.subs

Use try/except to catch these exceptions and use OSError/errno.ENOENT to
keep the code compatible with Python 2.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2017-09-21 16:15:54 -04:00
..
audit2allow Makefiles: drop -L/-I to system paths 2017-04-25 08:27:05 -04:00
chcat Fix BINDIR/SBINDIR/... variables in Makefiles 2017-06-20 12:18:26 -04:00
semanage Fix consistency of PYTHONLIBDIR variable across modules 2017-06-30 12:54:43 -04:00
sepolgen Python 3.6 invalid escape sequence deprecation fixes 2017-03-10 15:56:36 -05:00
sepolicy sepolicy: do not fail when file_contexts.local or .subs do not exist 2017-09-21 16:15:54 -04:00
COPYING Add COPYING files for new subdirs. 2016-11-16 11:19:51 -05:00
Makefile Move policycoreutils/{sepolicy,audit2allow,semanage,scripts/chcat*} and sepolgen to python. 2016-11-16 11:19:50 -05:00
VERSION Update VERSION files for 2.7 release. 2017-08-04 09:31:00 -04:00