python/semanage: Fix logger class definition

Test if audit module is enabled so that logger class is defined
correctly.

Fixes:
"semanage fcontext -l" fails with "OSError: Protocol not supported" when
booting with audit=0

Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
This commit is contained in:
Vit Mojzis 2018-07-09 20:29:40 +02:00 committed by Nicolas Iooss
parent d0ca433e21
commit cf8eed5431

View file

@ -101,6 +101,8 @@ ftype_to_audit = {"": "any",
try: try:
import audit import audit
#test if audit module is enabled
audit.audit_close(audit.audit_open())
class logger: class logger: