mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
tweak config mode check to just have a default
This commit is contained in:
parent
477ca2ed1a
commit
e9c9d8f523
1 changed files with 3 additions and 6 deletions
|
@ -130,18 +130,15 @@ class Facts(object):
|
||||||
self.facts['selinux']['policyvers'] = 'unknown'
|
self.facts['selinux']['policyvers'] = 'unknown'
|
||||||
try:
|
try:
|
||||||
(rc, configmode) = selinux.selinux_getenforcemode()
|
(rc, configmode) = selinux.selinux_getenforcemode()
|
||||||
if rc == 0 and configmode in Facts.SELINUX_MODE_DICT:
|
if rc == 0:
|
||||||
self.facts['selinux']['config_mode'] = Facts.SELINUX_MODE_DICT[configmode]
|
self.facts['selinux']['config_mode'] = Facts.SELINUX_MODE_DICT.get(configmode, 'unknown')
|
||||||
else:
|
else:
|
||||||
self.facts['selinux']['config_mode'] = 'unknown'
|
self.facts['selinux']['config_mode'] = 'unknown'
|
||||||
except OSError, e:
|
except OSError, e:
|
||||||
self.facts['selinux']['config_mode'] = 'unknown'
|
self.facts['selinux']['config_mode'] = 'unknown'
|
||||||
try:
|
try:
|
||||||
mode = selinux.security_getenforce()
|
mode = selinux.security_getenforce()
|
||||||
if mode in Facts.SELINUX_MODE_DICT:
|
self.facts['selinux']['mode'] = Facts.SELINUX_MODE_DICT.get(mode, 'unknown')
|
||||||
self.facts['selinux']['mode'] = Facts.SELINUX_MODE_DICT[mode]
|
|
||||||
else:
|
|
||||||
self.facts['selinux']['mode'] = 'unknown'
|
|
||||||
except OSError, e:
|
except OSError, e:
|
||||||
self.facts['selinux']['mode'] = 'unknown'
|
self.facts['selinux']['mode'] = 'unknown'
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue