Send an PushOver message with the data

def returner(ret):
    '''
    Send an PushOver message with the data
    '''

    _options = _get_options(ret)

    user = _options.get('user')
    device = _options.get('device')
    token = _options.get('token')
    title = _options.get('title')
    priority = _options.get('priority')
    expire = _options.get('expire')
    retry = _options.get('retry')
    sound = _options.get('sound')

    if not token:
        raise SaltInvocationError('Pushover token is unavailable.')

    if not user:
        raise SaltInvocationError('Pushover user key is unavailable.')

    if priority and priority == 2:
        if not expire and not retry:
            raise SaltInvocationError('Priority 2 requires pushover.expire and pushover.retry options.')

    message = ('id: {0}\r\n'
               'function: {1}\r\n'
               'function args: {2}\r\n'
               'jid: {3}\r\n'
               'return: {4}\r\n').format(
                    ret.get('id'),
                    ret.get('fun'),
                    ret.get('fun_args'),
                    ret.get('jid'),
                    pprint.pformat(ret.get('return')))

    result = _post_message(user=user,
                           device=device,
                           message=message,
                           title=title,
                           priority=priority,
                           expire=expire,
                           retry=retry,
                           sound=sound,
                           token=token)

    log.debug('pushover result %s', result)
    if not result['res']:
        log.info('Error: %s', result['message'])
    return