Update selinux.py

Fixed (hopefully) a couple of issues with the commit. That's what I get for parroting (and for not really knowing Python syntax yet).
This commit is contained in:
David J. Haines 2016-11-22 16:42:22 -05:00 committed by GitHub
parent 516a67e6a3
commit 7ef590a505

View file

@ -240,16 +240,16 @@ def list_semod():
.. versionadded:: 2016.3.0
'''
semodule_versioncheck = __salt__['cmd.run']('semodule -h').splitlines()
helptext = __salt__['cmd.run']('semodule -h').splitlines()
semodule_version = ''
for line in versioncheck[1:]:
for line in helptext:
if line.strip().startswith('full'):
semodule_version = 'new'
if semodule_version == 'new':
mdata = __salt__['cmd.run']('semodule -lfull').splitlines()
ret = {}
for line in mdata[0:]:
for line in mdata:
if not line.strip():
continue
comps = line.split()
@ -262,7 +262,7 @@ def list_semod():
else:
mdata = __salt__['cmd.run']('semodule -l').splitlines()
ret = {}
for line in mdata[0:]:
for line in mdata:
if not line.strip():
continue
comps = line.split()