Loading lib/galaxy/jobs/command_factory.py +2 −2 Original line number Diff line number Diff line Loading @@ -278,11 +278,11 @@ class CommandsBuilder: self.append_command("; ".join(c for c in commands if c)) def capture_stdout_stderr(self, stdout_file, stderr_file): trap_command = """trap 'rm "$__out" "$__err"' EXIT""" trap_command = """trap 'rm -f "$__out" "$__err"' EXIT""" if TRAP_KILL_CONTAINER in self.commands: # We need to replace the container kill trap with one that removes the named pipes and kills the container self.commands = self.commands.replace(TRAP_KILL_CONTAINER, "") trap_command = """trap 'rm "$__out" "$__err" 2> /dev/null || true; _on_exit' EXIT""" trap_command = """trap 'rm -f "$__out" "$__err"; _on_exit' EXIT""" self.prepend_command( f"""__out="${{TMPDIR:-.}}/out.$$" __err="${{TMPDIR:-.}}/err.$$" mkfifo "$__out" "$__err" Loading lib/galaxy/webapps/galaxy/api/__init__.py +3 −1 Original line number Diff line number Diff line Loading @@ -183,7 +183,9 @@ class GalaxyASGIRequest(GalaxyAbstractRequest): @property def host(self) -> str: return str(self.__request.client.host) client = self.__request.client assert client is not None return str(client.host) class GalaxyASGIResponse(GalaxyAbstractResponse): Loading test/unit/app/jobs/test_command_factory.py +3 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ CAPTURE_AND_REDIRECT = f"{TEE_REDIRECT}{RETURN_CODE_CAPTURE}" CP_WORK_DIR_OUTPUTS = '; \nif [ -f "foo" ] ; then cp "foo" "bar" ; fi' TEE_LOG = """__out="${TMPDIR:-.}/out.$$" __err="${TMPDIR:-.}/err.$$" mkfifo "$__out" "$__err" trap 'rm "$__out" "$__err"' EXIT trap 'rm -f "$__out" "$__err"' EXIT tee -a '../outputs/tool_stdout' < "$__out" & tee -a '../outputs/tool_stderr' < "$__err" >&2 & """ Loading Loading @@ -53,8 +53,8 @@ class TestCommandFactory(TestCase): self.include_work_dir_outputs = False self.job_wrapper.command_line = f"{TRAP_KILL_CONTAINER}{MOCK_COMMAND_LINE}" expected_command_line = self._surround_command(MOCK_COMMAND_LINE).replace( """trap 'rm "$__out" "$__err"' EXIT""", """trap 'rm "$__out" "$__err" 2> /dev/null || true; _on_exit' EXIT""" """trap 'rm -f "$__out" "$__err"' EXIT""", """trap 'rm -f "$__out" "$__err"; _on_exit' EXIT""" ) self.__assert_command_is(expected_command_line) Loading Loading
lib/galaxy/jobs/command_factory.py +2 −2 Original line number Diff line number Diff line Loading @@ -278,11 +278,11 @@ class CommandsBuilder: self.append_command("; ".join(c for c in commands if c)) def capture_stdout_stderr(self, stdout_file, stderr_file): trap_command = """trap 'rm "$__out" "$__err"' EXIT""" trap_command = """trap 'rm -f "$__out" "$__err"' EXIT""" if TRAP_KILL_CONTAINER in self.commands: # We need to replace the container kill trap with one that removes the named pipes and kills the container self.commands = self.commands.replace(TRAP_KILL_CONTAINER, "") trap_command = """trap 'rm "$__out" "$__err" 2> /dev/null || true; _on_exit' EXIT""" trap_command = """trap 'rm -f "$__out" "$__err"; _on_exit' EXIT""" self.prepend_command( f"""__out="${{TMPDIR:-.}}/out.$$" __err="${{TMPDIR:-.}}/err.$$" mkfifo "$__out" "$__err" Loading
lib/galaxy/webapps/galaxy/api/__init__.py +3 −1 Original line number Diff line number Diff line Loading @@ -183,7 +183,9 @@ class GalaxyASGIRequest(GalaxyAbstractRequest): @property def host(self) -> str: return str(self.__request.client.host) client = self.__request.client assert client is not None return str(client.host) class GalaxyASGIResponse(GalaxyAbstractResponse): Loading
test/unit/app/jobs/test_command_factory.py +3 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ CAPTURE_AND_REDIRECT = f"{TEE_REDIRECT}{RETURN_CODE_CAPTURE}" CP_WORK_DIR_OUTPUTS = '; \nif [ -f "foo" ] ; then cp "foo" "bar" ; fi' TEE_LOG = """__out="${TMPDIR:-.}/out.$$" __err="${TMPDIR:-.}/err.$$" mkfifo "$__out" "$__err" trap 'rm "$__out" "$__err"' EXIT trap 'rm -f "$__out" "$__err"' EXIT tee -a '../outputs/tool_stdout' < "$__out" & tee -a '../outputs/tool_stderr' < "$__err" >&2 & """ Loading Loading @@ -53,8 +53,8 @@ class TestCommandFactory(TestCase): self.include_work_dir_outputs = False self.job_wrapper.command_line = f"{TRAP_KILL_CONTAINER}{MOCK_COMMAND_LINE}" expected_command_line = self._surround_command(MOCK_COMMAND_LINE).replace( """trap 'rm "$__out" "$__err"' EXIT""", """trap 'rm "$__out" "$__err" 2> /dev/null || true; _on_exit' EXIT""" """trap 'rm -f "$__out" "$__err"' EXIT""", """trap 'rm -f "$__out" "$__err"; _on_exit' EXIT""" ) self.__assert_command_is(expected_command_line) Loading