def sections_present(name, sections=None, separator='='):
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'No anomaly detected'
           }
    if __opts__['test']:
        ret['result'] = True
        ret['comment'] = ''
        for section in sections or {}:
            cur_section = __salt__['ini.get_section'](name, section, separator)
            if cmp(dict(sections[section]), cur_section) == 0:
                ret['comment'] += 'Section unchanged {0}.\n'.format(section)
                continue
            elif cur_section:
                ret['comment'] += 'Changed existing section {0}.\n'.format(section)
            else:
                ret['comment'] += 'Created new section {0}.\n'.format(section)
            ret['result'] = None
        if ret['comment'] == '':
            ret['comment'] = 'No changes detected.'
        return ret
    section_to_update = {}
    for section_name in sections or []:
        section_to_update.update({section_name: {}})
    changes = __salt__['ini.set_option'](name, section_to_update, separator)
    if 'error' in changes:
        ret['result'] = False
        ret['changes'] = 'Errors encountered {0}'.format(changes['error'])
        return ret
    ret['changes'] = changes
    ret['comment'] = 'Changes take effect'
    return ret
Change password complete page.
dataset/ETHPy150Open saltstack/salt/salt/states/ini_manage.py/sections_present--crossover with--dataset/ETHPy150Open mozilla/kitsune/kitsune/users/views.py/password_change_complete