Skip to content

Commit

Permalink
Create empty primary file if we only have extra files dir
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed May 21, 2024
1 parent 2f83ef3 commit e80204e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/galaxy/metadata/set_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,12 @@ def set_meta(new_dataset_instance, file_dict):
)
dataset.dataset.created_from_basename = created_from_basename
elif os.path.exists(dataset_path_to_extra_path(external_filename)):
# Only output extra files dir, but no primary output file, that's fine
if dataset.datatype.composite_type == "auto_primary_file":
with open(external_filename, "wb"):
pass
pass
# Only output is extra files dir, but no primary output file, that's fine,
# but make sure we create an empty primary output file. It's a little
# weird to do this, but it does indicate that there's nothing wrong with the file,
# as opposed to perhaps a storage issue.
with open(external_filename, "wb"):
pass
else:
raise Exception(f"Output file '{external_filename}' not found")

Expand Down

0 comments on commit e80204e

Please sign in to comment.