def execute(self, scheduler, storage, product, *subjects):
Creates, runs, and returns an ExecutionRequest for the given product and subjects.
request = scheduler.execution_request([product], storage.puts(subjects))
res = LocalSerialEngine(scheduler, storage).execute(request)
if res.error:
raise res.error
return request
After Change
def execute(self, scheduler, storage, product, *subjects):
Runs an ExecutionRequest for the given product and subjects, and returns the result value.
request = self.execute_request(scheduler, storage, product, *subjects)
states = [storage.get(key) for key in scheduler.root_entries(request).values()]
if any(type(state) is not Return for state in states):
raise ValueError("At least one request failed: {}".format(states))
return list(state.value for state in states)