diff --git a/lib/galaxy/tool_util/provided_metadata.py b/lib/galaxy/tool_util/provided_metadata.py index 837c4e3d737..c4b995ab20d 100644 --- a/lib/galaxy/tool_util/provided_metadata.py +++ b/lib/galaxy/tool_util/provided_metadata.py @@ -54,7 +54,7 @@ class BaseToolProvidedMetadata(object): def has_failed_outputs(self): """Determine if generation of any of the outputs failed. - If True, this method should also log information about at the first such failed output. + If True, this method should also log information about at least the first such failed output. """ return False diff --git a/lib/galaxy/tools/evaluation.py b/lib/galaxy/tools/evaluation.py index 6134bc2574b..ca1ecf653a7 100644 --- a/lib/galaxy/tools/evaluation.py +++ b/lib/galaxy/tools/evaluation.py @@ -332,10 +332,12 @@ class ToolEvaluator(object): # Write outputs to the working directory (for security purposes) # if desired. param_dict[name] = DatasetFilenameWrapper(hda, compute_environment=self.compute_environment, io_type="output") - try: - open(str(param_dict[name]), 'w').close() - except EnvironmentError: - pass # May well not exist - e.g. Pulsar. + output_path = str(param_dict[name]) + # Conditionally create empty output: + # - may already exist (e.g. symlink output) + # - parent directory might not exist (e.g. Pulsar) + if not os.path.exists(output_path) and os.path.exists(os.path.dirname(output_path)): + open(output_path, 'w').close() # Provide access to a path to store additional files # TODO: move compute path logic into compute environment, move setting files_path diff --git a/test/integration/test_upload_configuration_options.py b/test/integration/test_upload_configuration_options.py index dd076d4e060..75a92529d93 100644 --- a/test/integration/test_upload_configuration_options.py +++ b/test/integration/test_upload_configuration_options.py @@ -213,6 +213,18 @@ class AdminsCanPasteFilePathsTestCase(BaseUploadContentConfigurationTestCase): # Test regression where this was getting deleted in this mode. assert os.path.exists(path) + def test_admin_path_paste_libraries_link(self): + library = self.library_populator.new_private_library("pathpasteallowedlibraries") + path = "%s/1.txt" % TEST_DATA_DIRECTORY + assert os.path.exists(path) + payload, files = self.library_populator.create_dataset_request(library, upload_option="upload_paths", paths=path, link_data=True) + response = self.library_populator.raw_library_contents_create(library["id"], payload, files=files) + assert response.status_code == 200 + assert os.path.exists(path) + self.library_populator.wait_on_library_dataset(library, response.json()[0]) + # We should probably verify the linking, but this was enough for now to exhibit + # https://github.com/galaxyproject/galaxy/issues/8756 + def test_admin_fetch(self): path = os.path.join(TEST_DATA_DIRECTORY, "1.txt") elements = [{"src": "path", "path": path}]