Commit f6c99a69 by Brian Coca

switched from sestatus to selinuxenabled as per recommendation

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
parent 98cc29f9
...@@ -265,10 +265,10 @@ class AnsibleModule(object): ...@@ -265,10 +265,10 @@ class AnsibleModule(object):
def selinux_enabled(self): def selinux_enabled(self):
if not HAVE_SELINUX: if not HAVE_SELINUX:
sestatus = get_bin_path('sestatus') seenabled = get_bin_path('selinuxenabled')
if sestatus is not None: if seenabled is not None:
(rc,out,err) = run_command(sestatus) (rc,out,err) = run_command(seenabled)
if rc == 0 and re.search('enabled', out): if rc == 0:
self.fail_json(msg="Aborting, target uses selinux but python bindings (python-selinux) aren't installed!") self.fail_json(msg="Aborting, target uses selinux but python bindings (python-selinux) aren't installed!")
return False return False
if selinux.is_selinux_enabled() == 1: if selinux.is_selinux_enabled() == 1:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment