Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
Raise userwarning if workflows can't be run
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Petter Øren Hauge authored and lars-petter-hauge committed Mar 1, 2019
1 parent 59bc1a1 commit 516fbf7
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions python/res/job_queue/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,21 @@ def run(self, ert, verbose=False, context=None):
"""
self.__running = True
success = self._try_compile(context)
if not success:
msg = "** Warning: The workflow file {} is not valid - "\
"make sure the workflow jobs are defined accordingly\n"
sys.stderr.write(msg.format(workflow.src_file))

if success:
for job, args in self:
self.__current_job = job
if not self.__cancelled:
return_value = job.run(ert, args, verbose)
self.__running = False
return False

if job.hasFailed():
print(return_value)
for job, args in self:
self.__current_job = job
if not self.__cancelled:
return_value = job.run(ert, args, verbose)

#todo store results?
if job.hasFailed():
print(return_value)

self.__current_job = None
self.__running = False
Expand Down

0 comments on commit 516fbf7

Please sign in to comment.