policycoreutils: audit2* - ignore setlocale errors
When a user has invalid locales set, audit2allow and audit2why fail with a traceback. This could be safely ignored as it will stay with 'C' locale. Fixes: Traceback (most recent call last): File "policycoreutils/audit2allow/audit2allow", line 35, in <module> locale.setlocale(locale.LC_ALL, '') File "/usr/lib64/python2.7/locale.py", line 579, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
This commit is contained in:
parent
cb0030ff5b
commit
663d76dbb6
|
@ -32,7 +32,10 @@ import sepolgen.module as module
|
||||||
from sepolgen.sepolgeni18n import _
|
from sepolgen.sepolgeni18n import _
|
||||||
import selinux.audit2why as audit2why
|
import selinux.audit2why as audit2why
|
||||||
import locale
|
import locale
|
||||||
|
try:
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class AuditToPolicy:
|
class AuditToPolicy:
|
||||||
|
|
|
@ -32,7 +32,10 @@ import sepolgen.module as module
|
||||||
from sepolgen.sepolgeni18n import _
|
from sepolgen.sepolgeni18n import _
|
||||||
import selinux.audit2why as audit2why
|
import selinux.audit2why as audit2why
|
||||||
import locale
|
import locale
|
||||||
|
try:
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class AuditToPolicy:
|
class AuditToPolicy:
|
||||||
|
|
Loading…
Reference in New Issue