Ensure job is pending before we associate and run.

This commit is contained in:
Joshua Harlow
2013-05-21 18:45:13 -07:00
parent 288d6a0d0d
commit 033e55fd12

View File

@@ -166,6 +166,10 @@ class Job(object):
for p in a_flow.parents:
associate_all(p)
if not flow.state != states.PENDING:
raise exc.InvalidStateException("Unable to run job when job is"
" in state %s" % (flow.state))
associate_all(flow)
return flow.run(self.context, *args, **kwargs)