Curently PollJob accepts a generic job, but will return (history
artifact) only the first opcode result. This is wrong, as it doesn't
allow polling of a job with multiple results.
Its only caller (for now) is also changed, so no functional changes
should happen.
Reviewed-by: ultrotter, amishchenko
status, result = jobs[0]
if status == constants.JOB_STATUS_SUCCESS:
- return result[0]
+ return result
else:
raise errors.OpExecError(result)
job_id = SendJob([op], cl)
- return PollJob(job_id, cl=cl, feedback_fn=feedback_fn)
+ op_results = PollJob(job_id, cl=cl, feedback_fn=feedback_fn)
+
+ return op_results[0]
def SubmitOrSend(op, opts, cl=None, feedback_fn=None):