From 44256971ebda2ba9b7f0a40a85752cc2c0851945 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 23 May 2019 15:07:17 +0200 Subject: [PATCH] Fix ColumnSetAction post job action If columns are specified as integers this would fail currently. Reported by Peter Briggs on the [mailing list](https://lists.galaxyproject.org/archives/list/galaxy-dev@lists.galaxyproject.org/thread/PXLCVKIZ5LW3MLI6333PFMANYGOCDLD2/) --- lib/galaxy/jobs/actions/post.py | 7 ++++--- lib/galaxy/workflow/modules.py | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/jobs/actions/post.py b/lib/galaxy/jobs/actions/post.py index fdfc4cd92dd..e309c26f558 100644 --- a/lib/galaxy/jobs/actions/post.py +++ b/lib/galaxy/jobs/actions/post.py @@ -277,9 +277,10 @@ class ColumnSetAction(DefaultJobAction): for k, v in action.action_arguments.items(): if v: # Try to use both pure integer and 'cX' format. - if v[0] == 'c': - v = v[1:] - v = int(v) + if not isinstance(v, int): + if v[0] == 'c': + v = v[1:] + v = int(v) if v != 0: setattr(dataset_assoc.dataset.metadata, k, v) diff --git a/lib/galaxy/workflow/modules.py b/lib/galaxy/workflow/modules.py index a75ef714f7a..b847d62cb3c 100644 --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -40,6 +40,7 @@ from galaxy.tools.parameters.basic import ( workflow_building_modes ) from galaxy.tools.parameters.wrapped import make_dict_copy +from galaxy.util import unicodify from galaxy.util.bunch import Bunch from galaxy.util.json import safe_loads from galaxy.util.odict import odict @@ -1124,7 +1125,7 @@ class ToolModule(WorkflowModule): replacement_parameters = set() for pja in step.post_job_actions: for argument in pja.action_arguments.values(): - for match in re.findall(r'\$\{(.+?)\}', argument): + for match in re.findall(r'\$\{(.+?)\}', unicodify(argument)): replacement_parameters.add(match) return list(replacement_parameters)