Commit ad5a1739 authored by Matthias Bernt's avatar Matthias Bernt
Browse files

overwrite upload paramfile after updating with incoming

the paramfile is created by `galaxy.tools.actions.upload_common.create_paramfile()`
and stored in `database/tmp/upload_params_TMPNAME` with mode 600 (it's
created with tmpfile, i.e. the mode is independent of the used umask).

`galaxy.jobs.MinimalJobWrapper.__prepare_upload_paramfile()` copies this
file to the jow working dir.

Without the change `ToolEvaluator.build_param_dict()` sets the paramfile
to the file in the jow working dir, but it is overwritten immediately
by the value in `incoming`.
parent 2fbbfd84
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -190,8 +190,6 @@ class ToolEvaluator:
        param_dict["__datatypes_config__"] = param_dict["GALAXY_DATATYPES_CONF_FILE"] = os.path.join(
            job_working_directory, "registry.xml"
        )
        if self.job.tool_id == "upload1":
            param_dict["paramfile"] = os.path.join(job_working_directory, "upload_params.json")
        if self._history:
            param_dict["__history_id__"] = self.app.security.encode_id(self._history.id)
        param_dict["__galaxy_url__"] = self.compute_environment.galaxy_url()
@@ -209,6 +207,11 @@ class ToolEvaluator:
        # Parameters added after this line are not sanitized
        self.__populate_non_job_params(param_dict)

        # MinimalJobWrapper.__prepare_upload_paramfile copies the paramfile to the job working directory
        # so we should use it (otherwise the upload tool does not work in real user setups)
        if self.job.tool_id == "upload1":
            param_dict["paramfile"] = os.path.join(job_working_directory, "upload_params.json")

        # Return the dictionary of parameters
        return param_dict