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:
parent
d0ca433e21
commit
cf8eed5431
1 changed files with 2 additions and 0 deletions
|
@ -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:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue