Skip to content

Commit

Permalink
Merge pull request #488 from dannon/tweaks
Browse files Browse the repository at this point in the history
Improve shortcut logic
  • Loading branch information
nsoranzo committed Jul 22, 2015
2 parents 90ddc23 + 14f966e commit 95a46d1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/galaxy/jobs/__init__.py
Expand Up @@ -1189,19 +1189,17 @@ def finish( self, stdout, stderr, tool_exit_code=None, remote_working_directory=
# either use the metadata from originating output dataset, or call set_meta on the copies
# it would be quicker to just copy the metadata from the originating output dataset,
# but somewhat trickier (need to recurse up the copied_from tree), for now we'll call set_meta()
if ( not self.external_output_metadata.external_metadata_set_successfully(
dataset, self.sa_session ) and
self.app.config.retry_metadata_internally ):
if ( self.app.config.retry_metadata_internally
and not self.external_output_metadata.external_metadata_set_successfully(dataset, self.sa_session ) ):
# If Galaxy was expected to sniff type and didn't - do so.
if dataset.ext == "_sniff_":
extension = sniff.handle_uploaded_dataset_file( dataset.dataset.file_name, self.app.datatypes_registry )
dataset.extension = extension

# call datatype.set_meta directly for the initial set_meta call during dataset creation
dataset.datatype.set_meta( dataset, overwrite=False )
elif ( not self.external_output_metadata.external_metadata_set_successfully(
dataset, self.sa_session ) and
job.states.ERROR != final_job_state ):
elif ( job.states.ERROR != final_job_state
and not self.external_output_metadata.external_metadata_set_successfully( dataset, self.sa_session ) ):
dataset._state = model.Dataset.states.FAILED_METADATA
else:
# load metadata from file
Expand Down

0 comments on commit 95a46d1

Please sign in to comment.