From d3e14ec6731d6f0524ff8f2575a100555de2fe25 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 15 Sep 2015 16:55:42 -0400 Subject: [PATCH] Check to make sure a job is actually part of a workflow invocation prior to attempting to clean other workflow steps. This prevents an error when a 'clean intermediates' type job is remapped. TODO: Perhaps the job should actually be replaced in the workflow invocation as well, but this is a decent defensive check anyway. --- lib/galaxy/jobs/actions/post.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/galaxy/jobs/actions/post.py b/lib/galaxy/jobs/actions/post.py index b8145d7ae83..87fa0ddf200 100644 --- a/lib/galaxy/jobs/actions/post.py +++ b/lib/galaxy/jobs/actions/post.py @@ -404,6 +404,9 @@ class DeleteIntermediatesAction(DefaultJobAction): # POTENTIAL ISSUES: When many outputs are being finish()ed # concurrently, sometimes non-terminal steps won't be cleaned up # because of the lag in job state updates. + if not job.workflow_invocation_step: + log.debug("This job is not part of a workflow invocation, delete intermediates aborted.") + return wfi = job.workflow_invocation_step.workflow_invocation if wfi.active: log.debug("Workflow still scheduling so new jobs may appear, skipping deletion of intermediate files.")