mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fixed ini.options_absent. Resolves #33590.
This commit is contained in:
parent
a7713806e9
commit
fb13852102
1 changed files with 9 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue