mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Explicitly create extra_files_path when discovering outputs with extra files
This commit is contained in:
@@ -2184,6 +2184,10 @@ class Dataset(StorableObject, RepresentById):
|
||||
else:
|
||||
return os.path.abspath(self.external_extra_files_path)
|
||||
|
||||
def create_extra_files_path(self):
|
||||
if not self.extra_files_path_exists():
|
||||
self.object_store.create(self, dir_only=True, extra_dir=self._extra_files_rel_path)
|
||||
|
||||
def set_extra_files_path(self, extra_files_path):
|
||||
if not extra_files_path:
|
||||
self.external_extra_files_path = None
|
||||
|
||||
@@ -316,6 +316,7 @@ def collect_primary_datasets(job_context, output, input_ext):
|
||||
extra_files_path = new_primary_datasets_attributes.get('extra_files', None)
|
||||
if extra_files_path:
|
||||
extra_files_path_joined = os.path.join(job_working_directory, extra_files_path)
|
||||
primary_data.dataset.create_extra_files_path()
|
||||
for root, dirs, files in os.walk(extra_files_path_joined):
|
||||
extra_dir = os.path.join(primary_data.extra_files_path, root.replace(extra_files_path_joined, '', 1).lstrip(os.path.sep))
|
||||
extra_dir = os.path.normpath(extra_dir)
|
||||
|
||||
@@ -283,7 +283,7 @@ def test_import_export_composite_datasets():
|
||||
h = model.History(name="Test History", user=u)
|
||||
|
||||
d1 = _create_datasets(sa_session, h, 1, extension="html")[0]
|
||||
app.object_store.create(d1.dataset, dir_only=True, extra_dir=d1.dataset._extra_files_rel_path)
|
||||
d1.dataset.create_extra_files_path()
|
||||
sa_session.add_all((h, d1))
|
||||
sa_session.flush()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user