Unverified Commit e8aeedaf authored by mvdbeek's avatar mvdbeek
Browse files

Defer to compute_environment.input_extra_files_rewrite for path_rewrite

parent 61f8123b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -121,7 +121,8 @@ class SharedComputeEnvironment(SimpleComputeEnvironment, ComputeEnvironment):
        return self.job_io.get_output_fnames()

    def input_path_rewrite(self, dataset):
        return self.job_io.get_input_path(dataset).false_path
        dataset_path = self.job_io.get_input_path(dataset)
        return dataset_path.false_path or dataset_path.real_path

    def output_path_rewrite(self, dataset):
        dataset_path = self.job_io.get_output_path(dataset)
@@ -131,7 +132,10 @@ class SharedComputeEnvironment(SimpleComputeEnvironment, ComputeEnvironment):
            return dataset_path.real_path

    def input_extra_files_rewrite(self, dataset):
        return None
        input_path_rewrite = self.input_path_rewrite(dataset)
        base_input_path = input_path_rewrite[0 : -len(".dat")]
        remote_extra_files_path_rewrite = f"{base_input_path}_files"
        return remote_extra_files_path_rewrite

    def output_extra_files_rewrite(self, dataset):
        output_path_rewrite = self.output_path_rewrite(dataset)
+5 −26
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ from typing import (
    Union,
)

from galaxy import exceptions
from galaxy.model import (
    DatasetCollection,
    DatasetCollectionElement,
@@ -476,33 +475,13 @@ class DatasetFilenameWrapper(ToolParameterValueWrapper):
            # Path to dataset was rewritten for this job.
            return self.false_path
        elif key in ("extra_files_path", "files_path"):
            if not self.compute_environment:
                # Only happens in WrappedParameters context, refactor!
                return self.unsanitized.extra_files_path
            if self.__io_type == "input":
                path_rewrite = self.compute_environment and self.compute_environment.input_extra_files_rewrite(
                    self.unsanitized
                )
            else:
                path_rewrite = self.compute_environment and self.compute_environment.output_extra_files_rewrite(
                    self.unsanitized
                )
            if path_rewrite:
                return path_rewrite
                return self.compute_environment.input_extra_files_rewrite(self.unsanitized)
            else:
                try:
                    # Assume it is an output and that this wrapper
                    # will be set with correct "files_path" for this
                    # job.
                    return self.files_path
                except AttributeError:
                    # Otherwise, we have an input - delegate to model and
                    # object store to find the static location of this
                    # directory.
                    try:
                        return self.unsanitized.extra_files_path
                    except exceptions.ObjectNotFound:
                        # NestedObjectstore raises an error here
                        # instead of just returning a non-existent
                        # path like DiskObjectStore.
                        raise
                return self.compute_environment.output_extra_files_rewrite(self.unsanitized)
        elif key == "serialize":
            return self.serialize
        else: