From 657b1552380f8838cea05eefc36038e66fabd518 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 6 Jul 2020 16:25:21 +0200 Subject: [PATCH] actually `set -e` for non-legacy tools before strict mode was only used if the command block was absent --- lib/galaxy/tool_util/parser/xml.py | 12 ++++++---- test/functional/tools/samples_tool_conf.xml | 1 + .../functional/tools/strict_shell_profile.xml | 23 +++++++++++++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 test/functional/tools/strict_shell_profile.xml diff --git a/lib/galaxy/tool_util/parser/xml.py b/lib/galaxy/tool_util/parser/xml.py index 0a4b9613f74..39ba1a977be 100644 --- a/lib/galaxy/tool_util/parser/xml.py +++ b/lib/galaxy/tool_util/parser/xml.py @@ -488,12 +488,14 @@ class XmlToolSource(ToolSource): def parse_strict_shell(self): command_el = self._command_el - if command_el is not None: - return string_as_bool(command_el.get("strict", "False")) - elif self.legacy_defaults: - return False + if self.legacy_defaults: + default = "False" else: - return True + default = "True" + if command_el is not None: + return string_as_bool(command_el.get("strict", default)) + else: + return string_as_bool(default) def parse_help(self): help_elem = self.root.find('help') diff --git a/test/functional/tools/samples_tool_conf.xml b/test/functional/tools/samples_tool_conf.xml index 4db887d296f..7945698d06b 100644 --- a/test/functional/tools/samples_tool_conf.xml +++ b/test/functional/tools/samples_tool_conf.xml @@ -57,6 +57,7 @@ + diff --git a/test/functional/tools/strict_shell_profile.xml b/test/functional/tools/strict_shell_profile.xml new file mode 100644 index 00000000000..f397200e8c4 --- /dev/null +++ b/test/functional/tools/strict_shell_profile.xml @@ -0,0 +1,23 @@ + + + echo "Hello" > $out_file1 + ; sh -c "exit $exit_code" + ; sh -c "exit 0" + + + + + + + + + + + + + + + + + +