Retrieve the (latest) logs and retrieve the status for a UPID.
    This can be used to verify whether a task has completed.

def _lookup_proxmox_task(upid):
    '''
    Retrieve the (latest) logs and retrieve the status for a UPID.
    This can be used to verify whether a task has completed.
    '''
    log.debug('Getting creation status for upid: %s', upid)
    tasks = query('get', 'cluster/tasks')

    if tasks:
        for task in tasks:
            if task['upid'] == upid:
                log.debug('Found upid task: %s', task)
                return task

    return False