Delete a splunk user by email

    CLI Example:

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

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, HTTPError) as e:
            log.info('Exception: %s', e)
            return False
    else:
        return False

    return user.name not in client.users