def absent(name):
    ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}

    # Comment and change messages
    comment_usergroup_deleted = 'User group {0} deleted.'.format(name)
    comment_usergroup_notdeleted = 'Unable to delete user group: {0}. '.format(name)
    comment_usergroup_notexists = 'User group {0} does not exist.'.format(name)
    changes_usergroup_deleted = {name: {'old': 'User group {0} exists.'.format(name),
                                        'new': 'User group {0} deleted.'.format(name),
                                        }
                                 }

    usergroup_exists = __salt__['zabbix.usergroup_exists'](name)

    # Dry run, test=true mode
    if __opts__['test']:
        if not usergroup_exists:
            ret['result'] = True
            ret['comment'] = comment_usergroup_notexists
        else:
            ret['result'] = None
            ret['comment'] = comment_usergroup_deleted
        return ret

    usergroup_get = __salt__['zabbix.usergroup_get'](name)

    if not usergroup_get:
        ret['result'] = True
        ret['comment'] = comment_usergroup_notexists
    else:
        try:
            usrgrpid = usergroup_get[0]['usrgrpid']
            usergroup_delete = __salt__['zabbix.usergroup_delete'](usrgrpid)
        except KeyError:
            usergroup_delete = False

        if usergroup_delete and 'error' not in usergroup_delete:
            ret['result'] = True
            ret['comment'] = comment_usergroup_deleted
            ret['changes'] = changes_usergroup_deleted
        else:
            ret['result'] = False
            ret['comment'] = comment_usergroup_notdeleted + str(usergroup_delete['error'])

    return ret
Ensures that the user group does not exist, eventually delete user group.
dataset/ETHPy150Open saltstack/salt/salt/states/zabbix_usergroup.py/absent