def absent(name,
           host='localhost',
           **connection_args):
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': ''}

    # Check if user exists, and if so, remove it
    if __salt__['mysql.user_exists'](name, host, **connection_args):
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'User {0}@{1} is set to be removed'.format(
                    name,
                    host)
            return ret
        if __salt__['mysql.user_remove'](name, host, **connection_args):
            ret['comment'] = 'User {0}@{1} has been removed'.format(name, host)
            ret['changes'][name] = 'Absent'
            return ret
        else:
            err = _get_mysql_error()
            if err is not None:
                ret['comment'] = err
                ret['result'] = False
                return ret
    else:
        err = _get_mysql_error()
        if err is not None:
            ret['comment'] = err
            ret['result'] = False
            return ret

    # fallback
    ret['comment'] = (
            'User {0}@{1} is not present, so it cannot be removed'
            ).format(name, host)
    return ret
Get handler to sync groups from external group storage systems.
dataset/ETHPy150Open saltstack/salt/salt/states/mysql_user.py/absent--crossover with--dataset/ETHPy150Open google/cauliflowervest/src/cauliflowervest/server/cron/group_sync.py/GroupSync.get