commit/galaxy-central: 3 new changesets
3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/e034999e8b1a/ Changeset: e034999e8b1a User: jmchilton Date: 2014-01-29 15:36:32 Summary: Bugfix: History import when 'cleanup_job=never'. Affected #: 1 file diff -r 6a7cb977238c76359f39c8484b88cdd1daff4b1f -r e034999e8b1a2820f81e6fe64c623b7417e38148 lib/galaxy/jobs/__init__.py --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -789,8 +789,8 @@ # If the job was deleted, call tool specific fail actions (used for e.g. external metadata) and clean up if self.tool: self.tool.job_failed( self, message, exception ) - if self.app.config.cleanup_job == 'always' or (self.app.config.cleanup_job == 'onsuccess' and job.state == job.states.DELETED): - self.cleanup() + delete_files = self.app.config.cleanup_job == 'always' or (self.app.config.cleanup_job == 'onsuccess' and job.state == job.states.DELETED) + self.cleanup( delete_files=delete_files ) def pause( self, job=None, message=None ): if job is None: @@ -1067,22 +1067,27 @@ self.sa_session.flush() log.debug( 'job %d ended' % self.job_id ) - if self.app.config.cleanup_job == 'always' or ( not stderr and self.app.config.cleanup_job == 'onsuccess' ): - self.cleanup() + # TODO: Also fix "not stderr" below, use final_job_state. + delete_files = self.app.config.cleanup_job == 'always' or ( not stderr and self.app.config.cleanup_job == 'onsuccess' ) + self.cleanup( delete_files=delete_files ) def check_tool_output( self, stdout, stderr, tool_exit_code, job ): return check_output( self.tool, stdout, stderr, tool_exit_code, job ) - def cleanup( self ): - # remove temporary files + def cleanup( self, delete_files=True ): + # At least one of these tool cleanup actions (job import), is needed + # for thetool to work properly, that is why one might want to run + # cleanup but not delete files. try: - for fname in self.extra_filenames: - os.remove( fname ) - self.external_output_metadata.cleanup_external_metadata( self.sa_session ) + if delete_files: + for fname in self.extra_filenames: + os.remove( fname ) + self.external_output_metadata.cleanup_external_metadata( self.sa_session ) galaxy.tools.imp_exp.JobExportHistoryArchiveWrapper( self.job_id ).cleanup_after_job( self.sa_session ) galaxy.tools.imp_exp.JobImportHistoryArchiveWrapper( self.app, self.job_id ).cleanup_after_job() galaxy.tools.genome_index.GenomeIndexToolWrapper( self.job_id ).postprocessing( self.sa_session, self.app ) - self.app.object_store.delete(self.get_job(), base_dir='job_work', entire_dir=True, dir_only=True, extra_dir=str(self.job_id)) + if delete_files: + self.app.object_store.delete(self.get_job(), base_dir='job_work', entire_dir=True, dir_only=True, extra_dir=str(self.job_id)) except: log.exception( "Unable to cleanup job %d" % self.job_id ) @@ -1520,8 +1525,8 @@ # if the job was deleted, don't finish it if task.state == task.states.DELETED: # Job was deleted by an administrator - if self.app.config.cleanup_job in ( 'always', 'onsuccess' ): - self.cleanup() + delete_files = self.app.config.cleanup_job in ( 'always', 'onsuccess' ) + self.cleanup( delete_files=delete_files ) return elif task.state == task.states.ERROR: self.fail( task.info ) https://bitbucket.org/galaxy/galaxy-central/commits/40d94d94900b/ Changeset: 40d94d94900b User: jmchilton Date: 2014-01-29 15:36:32 Summary: Bugfix: cleanup_job for newer job error checking logic. Affected #: 1 file diff -r e034999e8b1a2820f81e6fe64c623b7417e38148 -r 40d94d94900b82be76e11b778626d09a421e4966 lib/galaxy/jobs/__init__.py --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -1067,8 +1067,7 @@ self.sa_session.flush() log.debug( 'job %d ended' % self.job_id ) - # TODO: Also fix "not stderr" below, use final_job_state. - delete_files = self.app.config.cleanup_job == 'always' or ( not stderr and self.app.config.cleanup_job == 'onsuccess' ) + delete_files = self.app.config.cleanup_job == 'always' or ( job.state == job.states.OK and self.app.config.cleanup_job == 'onsuccess' ) self.cleanup( delete_files=delete_files ) def check_tool_output( self, stdout, stderr, tool_exit_code, job ): https://bitbucket.org/galaxy/galaxy-central/commits/07dceba219c3/ Changeset: 07dceba219c3 User: jmchilton Date: 2014-01-29 15:36:32 Summary: Eliminate unneeded if in jobs/__init__.py. Checking if job.state is ERROR when that cannot be (method returns self.fail above this if that were the case). Even if it were somehow possible, subsequent code would fail badly with final_job_state not being set. Affected #: 1 file diff -r 40d94d94900b82be76e11b778626d09a421e4966 -r 07dceba219c315e2857f105abfdaf030efa1f16c lib/galaxy/jobs/__init__.py --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -883,11 +883,10 @@ # We set final_job_state to use for dataset management, but *don't* set # job.state until after dataset collection to prevent history issues - if job.states.ERROR != job.state: - if ( self.check_tool_output( stdout, stderr, tool_exit_code, job )): - final_job_state = job.states.OK - else: - final_job_state = job.states.ERROR + if ( self.check_tool_output( stdout, stderr, tool_exit_code, job ) ): + final_job_state = job.states.OK + else: + final_job_state = job.states.ERROR if self.version_string_cmd: version_filename = self.get_version_string_path() Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org