def delete_user(email, profile="splunk"):
    '''
    Delete a splunk user by email

    CLI Example:

        salt myminion splunk_user.delete 'user@example.com'
    '''

    client = _get_splunk(profile)

    user = list_users(profile).get(email)

    if user:
        try:
            client.users.delete(user.name)
        except (AuthenticationError, __HOLE__) as e:
            log.info('Exception: {0}'.format(str(e)))
            return False
    else:
        return False

    return user.name not in client.users
dataset/ETHPy150Open saltstack/salt/salt/modules/splunk.py/delete_user