Merge pull request #33606 from danslimmon/ini-optionsabsent-33590

Fixed ini.options_absent. Resolves #33590.
This commit is contained in:
Mike Place 2016-05-31 08:51:35 -07:00
commit 23506f8279

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