commit/galaxy-central: natefoo: Prevent upload job creation from clobbering the input if linking data into Galaxy.
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/38fe5eeb1d6f/ changeset: 38fe5eeb1d6f branches: user: natefoo date: 2011-06-03 21:18:31 summary: Prevent upload job creation from clobbering the input if linking data into Galaxy. affected #: 2 files (338 bytes) --- a/lib/galaxy/jobs/__init__.py Fri Jun 03 11:25:02 2011 -0400 +++ b/lib/galaxy/jobs/__init__.py Fri Jun 03 15:18:31 2011 -0400 @@ -752,7 +752,10 @@ sizes = [] output_paths = self.get_output_fnames() for outfile in [ str( o ) for o in output_paths ]: - sizes.append( ( outfile, os.stat( outfile ).st_size ) ) + if os.path.exists( outfile ): + sizes.append( ( outfile, os.stat( outfile ).st_size ) ) + else: + sizes.append( ( outfile, 0 ) ) return sizes def setup_external_metadata( self, exec_dir = None, tmp_dir = None, dataset_files_path = None, config_root = None, datatypes_config = None, set_extension = True, **kwds ): @@ -999,7 +1002,10 @@ sizes = [] output_paths = self.get_output_fnames() for outfile in [ str( o ) for o in output_paths ]: - sizes.append( ( outfile, os.stat( outfile ).st_size ) ) + if os.path.exists( outfile ): + sizes.append( ( outfile, os.stat( outfile ).st_size ) ) + else: + sizes.append( ( outfile, 0 ) ) return sizes def setup_external_metadata( self, exec_dir = None, tmp_dir = None, dataset_files_path = None, config_root = None, datatypes_config = None, set_extension = True, **kwds ): --- a/lib/galaxy/tools/actions/upload_common.py Fri Jun 03 11:25:02 2011 -0400 +++ b/lib/galaxy/tools/actions/upload_common.py Fri Jun 03 15:18:31 2011 -0400 @@ -323,12 +323,14 @@ for i, dataset in enumerate( data_list ): job.add_output_library_dataset( 'output%i' % i, dataset ) # Create an empty file immediately - open( dataset.file_name, "w" ).close() + if not dataset.dataset.external_filename: + open( dataset.file_name, "w" ).close() else: for i, dataset in enumerate( data_list ): job.add_output_dataset( 'output%i' % i, dataset ) # Create an empty file immediately - open( dataset.file_name, "w" ).close() + if not dataset.dataset.external_filename: + open( dataset.file_name, "w" ).close() job.state = job.states.NEW trans.sa_session.add( job ) trans.sa_session.flush() 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)
-
Bitbucket