From c1fe8aac0a646b2bed0b3dbfbf0cd75b595f1690 Mon Sep 17 00:00:00 2001 From: guerler Date: Wed, 23 Mar 2016 13:29:38 -0400 Subject: [PATCH] Fix inconsistency in update state handling for tool modules --- lib/galaxy/tools/__init__.py | 8 +------- lib/galaxy/workflow/modules.py | 11 +++-------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index c9175afa763..30c40c4611b 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1661,12 +1661,6 @@ class Tool( object, Dictifiable ): tool_model[ 'inputs' ] = {} populate_model( self.inputs, state_inputs, tool_model[ 'inputs' ] ) - # sanitize tool state - def value_to_basic( input, value, parent, **kwargs ): - parent[ input.name ] = input.value_to_basic( value, self.app ) - - visit_input_values( self.inputs, state_inputs, value_to_basic ) - # create tool help tool_help = '' if self.help: @@ -1692,7 +1686,7 @@ class Tool( object, Dictifiable ): 'versions' : tool_versions, 'requirements' : [ { 'name' : r.name, 'version' : r.version } for r in self.requirements ], 'errors' : state_errors, - 'state_inputs' : state_inputs, + 'state_inputs' : params_to_strings( self.inputs, state_inputs, self.app ), 'job_id' : trans.security.encode_id( job.id ) if job else None, 'job_remap' : self._get_job_remap( job ), 'history_id' : trans.security.encode_id( history.id ), diff --git a/lib/galaxy/workflow/modules.py b/lib/galaxy/workflow/modules.py index 356625e0f5a..d60be2364ae 100644 --- a/lib/galaxy/workflow/modules.py +++ b/lib/galaxy/workflow/modules.py @@ -1,7 +1,6 @@ """ Modules used in building workflows """ -import copy import logging from json import dumps, loads from xml.etree.ElementTree import Element @@ -965,11 +964,8 @@ class ToolModule( WorkflowModule ): input_dicts.append( { "name": name, "description": "runtime parameter for tool %s" % self.get_name() } ) return input_dicts - def get_post_job_actions( self, incoming=None): - if incoming is None: - return self.post_job_actions - else: - return ActionBox.handle_incoming(incoming) + def get_post_job_actions( self, incoming ): + return ActionBox.handle_incoming( incoming ) def get_config_form( self ): self.add_dummy_datasets() @@ -977,8 +973,7 @@ class ToolModule( WorkflowModule ): tool=self.tool, values=self.state.inputs, errors=( self.errors or {} ) ) def update_state( self, incoming ): - self.label = incoming.get( 'label' ) - self.state.inputs = copy.deepcopy( incoming ) + self.recover_state( incoming ) def check_and_update_state( self ): inputs = self.state.inputs