Addressed edge case when attempting to set the config file to 'Disabled'. The state should only check the file, since the in-memory setting won't disappear until after reboot.

This commit is contained in:
nicholasmhughes 2017-02-03 09:08:31 -05:00
parent 6858658cc2
commit a6a24e1a1b

View File

@ -116,7 +116,7 @@ def mode(name):
return ret
oldmode, mode = mode, __salt__['selinux.setenforce'](tmode)
if mode == tmode:
if mode == tmode or (tmode == 'Disabled' and __salt__['selinux.getconfig']() == tmode):
ret['result'] = True
ret['comment'] = 'SELinux has been set to {0} mode'.format(tmode)
ret['changes'] = {'old': oldmode,