1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Avoid using an object if it does not exists (#19058)

This commit is contained in:
Fabio Alessandro Locati 2016-12-09 22:36:39 +00:00 committed by John R Barker
parent 28a12e8b27
commit 9a075b5917

View file

@ -103,7 +103,8 @@ except ImportError:
HAVE_SEOBJECT=False
### Add missing entries (backward compatible)
seobject.file_types.update(dict(
if HAVE_SEOBJECT:
seobject.file_types.update(dict(
a = seobject.SEMANAGE_FCONTEXT_ALL,
b = seobject.SEMANAGE_FCONTEXT_BLOCK,
c = seobject.SEMANAGE_FCONTEXT_CHAR,
@ -112,7 +113,7 @@ seobject.file_types.update(dict(
l = seobject.SEMANAGE_FCONTEXT_LINK,
p = seobject.SEMANAGE_FCONTEXT_PIPE,
s = seobject.SEMANAGE_FCONTEXT_SOCK,
))
))
### Make backward compatible
option_to_file_type_str = dict(