def absent(name):
    '''
    Ensures that the host group does not exist, eventually delete host group.

    .. versionadded:: 2016.3.0

    :param name: name of the host group
    :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
    :param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
    :param _connection_url: Optional - url of zabbix frontend (can also be set in opts, pillar, see module's docstring)

    .. code-block:: yaml

        delete_testing_host_group:
            zabbix_hostgroup.absent:
                - name: 'My hostgroup name'

    '''

    ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}

    # Comment and change messages
    comment_hostgroup_deleted = 'Host group {0} deleted.'.format(name)
    comment_hostgroup_notdeleted = 'Unable to delete host group: {0}. '.format(name)
    comment_hostgroup_notexists = 'Host group {0} does not exist.'.format(name)
    changes_hostgroup_deleted = {name: {'old': 'Host group {0} exists.'.format(name),
                                        'new': 'Host group {0} deleted.'.format(name),
                                        }
                                 }

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

    # Dry run, test=true mode
    if __opts__['test']:
        if not hostgroup_exists:
            ret['result'] = True
            ret['comment'] = comment_hostgroup_notexists
        else:
            ret['result'] = None
            ret['comment'] = comment_hostgroup_deleted
            ret['changes'] = changes_hostgroup_deleted
        return ret

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

    if not hostgroup_get:
        ret['result'] = True
        ret['comment'] = comment_hostgroup_notexists
    else:
        try:
            groupid = hostgroup_get[0]['groupid']
            hostgroup_delete = __salt__['zabbix.hostgroup_delete'](groupid)
        except __HOLE__:
            hostgroup_delete = False

        if hostgroup_delete and 'error' not in hostgroup_delete:
            ret['result'] = True
            ret['comment'] = comment_hostgroup_deleted
            ret['changes'] = changes_hostgroup_deleted
        else:
            ret['result'] = False
            ret['comment'] = comment_hostgroup_notdeleted + str(hostgroup_delete['error'])

    return ret
dataset/ETHPy150Open saltstack/salt/salt/states/zabbix_hostgroup.py/absent