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

Commit

Permalink
fixup! 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 committed Feb 27, 2019
1 parent c005d40 commit af3101e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 3 additions & 1 deletion python/res/enkf/hook_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ def runWorkflows(self , run_time , ert_self):
continue

workflow = hook_workflow.getWorkflow()
workflow.run(ert_self, context=workflow_list.getContext())
success = workflow.run(ert_self, context=workflow_list.getContext())
if not success:
sys.stderr.write("The workflow {} is not valid".format(workflow.src_file))
18 changes: 8 additions & 10 deletions python/res/job_queue/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,14 @@ def run(self, ert, verbose=False, context=None):
"""
self.__running = True
success = self._try_compile(context)
if not success:
raise UserWarning("The workflow {} is not valid".format(self.src_file))

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

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

if job.hasFailed():
print(return_value)

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

0 comments on commit af3101e

Please sign in to comment.