Remaining case means that the value is in configured and current, check if the value is set correctly (and return True appropriately), if not then it needs to be set

This commit is contained in:
Thomas Jackson 2014-05-27 18:17:18 -07:00
parent 9e15a69b30
commit 6c1113bd88

View File

@ -77,8 +77,15 @@ def present(name, value, config=None):
ret['comment'] = 'Sysctl option {0} set to be changed to {1}'.format(name, value)
return ret
else:
ret['result'] = False
ret['comment'] = 'Invalid sysctl option {0} = {1}'.format(name, value)
if str(value) == __salt__['sysctl.get'](name):
ret['result'] = True
ret['comment'] = 'Sysctl value {0} = {1} is already set'.format(
name,
value
)
else:
ret['result'] = None
ret['comment'] = 'Sysctl option {0} set to be changed to {1}'.format(name, value)
return ret
update = __salt__['sysctl.persist'](name, value, config)