Fixed ini.options_absent. Resolves #33590.

This commit is contained in:
Dan Slimmon 2016-05-29 03:00:47 +00:00
parent a7713806e9
commit fb13852102

View file

@ -109,14 +109,15 @@ def options_absent(name, sections=None):
ret['comment'] = 'No changes detected.'
return ret
sections = sections or {}
for section, key in sections.iteritems():
current_value = __salt__['ini.remove_option'](name, section, key)
if not current_value:
continue
if section not in ret['changes']:
ret['changes'].update({section: {}})
ret['changes'][section].update({key: current_value})
ret['comment'] = 'Changes take effect'
for section, keys in sections.iteritems():
for key in keys:
current_value = __salt__['ini.remove_option'](name, section, key)
if not current_value:
continue
if section not in ret['changes']:
ret['changes'].update({section: {}})
ret['changes'][section].update({key: current_value})
ret['comment'] = 'Changes take effect'
return ret