'Check if call is async, wait for it to complete.
:param operation: the operation being performed
:param status_code: the status code
:param job: the job
:param extra_specs: the extra specifications
:returns: task -- list of dicts detailing tasks in the job
:raises: VolumeBackendAPIException'

def wait_for_job(self, operation, status_code, job, extra_specs):

    task = None
    if (status_code == STATUS_202):
        (rc, result, status, task) = self.wait_for_job_complete(job, extra_specs)
        if (rc != 0):
            exception_message = (_('Error    %(operation)s.    Status    code:    %(sc)lu.    Error:    %(error)s.    Status:    %(status)s.') % {'operation': operation, 'sc': rc, 'error': six.text_type(result), 'status': status})
            LOG.error(exception_message)
            raise exception.VolumeBackendAPIException(data=exception_message)
    return task
