Skip to content

Instantly share code, notes, and snippets.

@jmchilton
Created May 30, 2014 18:19
Show Gist options
  • Save jmchilton/a99c24c50b23374dc568 to your computer and use it in GitHub Desktop.
Save jmchilton/a99c24c50b23374dc568 to your computer and use it in GitHub Desktop.
diff --git a/lib/galaxy/jobs/runners/lwr.py b/lib/galaxy/jobs/runners/lwr.py
index 6c4efba..1b4c821 100644
--- a/lib/galaxy/jobs/runners/lwr.py
+++ b/lib/galaxy/jobs/runners/lwr.py
@@ -533,6 +533,7 @@ class LwrComputeEnvironment( ComputeEnvironment ):
return parameter_value
rewrite, new_unstructured_path_rewrites = self.path_mapper.check_for_arbitrary_rewrite( parameter_value )
+ log.info("Checked for arbitrary rewrite of %s, do rewrite? %s" % ( parameter_value, rewrite ) )
if rewrite:
unstructured_path_rewrites.update(new_unstructured_path_rewrites)
return rewrite
diff --git a/lib/galaxy/jobs/runners/lwr_client/path_mapper.py b/lib/galaxy/jobs/runners/lwr_client/path_mapper.py
index 9ff70d2..b5836d0 100644
--- a/lib/galaxy/jobs/runners/lwr_client/path_mapper.py
+++ b/lib/galaxy/jobs/runners/lwr_client/path_mapper.py
@@ -5,6 +5,9 @@ from .util import PathHelper
from galaxy.util import in_directory
+import logging
+log = logging.getLogger(__name__)
+
class PathMapper(object):
""" Ties together a FileActionMapper and remote job configuration returned
@@ -53,11 +56,14 @@ class PathMapper(object):
return remote_path
def check_for_arbitrary_rewrite(self, local_path):
+ local_path = str(local_path) # Use false_path if needed.
+ log.info("Checking if path %s exists" % local_path)
if not os.path.exists(local_path):
return None, []
- path = str(local_path) # Use false_path if needed.
+ path = local_path
action = self.action_mapper.action(path, path_type.UNSTRUCTURED)
+ log.info("Action for path %s is %s" % ( local_path, action ) )
if not action.staging_needed:
return action.path_rewrite(self.path_helper), []
unique_names = action.unstructured_map()
diff --git a/lib/galaxy/tools/wrappers.py b/lib/galaxy/tools/wrappers.py
index 62f4f8c..223959f 100644
--- a/lib/galaxy/tools/wrappers.py
+++ b/lib/galaxy/tools/wrappers.py
@@ -112,13 +112,16 @@ class SelectToolParameterWrapper( ToolParameterValueWrapper ):
def __getattr__( self, name ):
if name not in self._fields:
self._fields[ name ] = self._input.options.get_field_by_name_for_value( name, self._value, None, self._other_values )
- return self._input.separator.join( map( self._path_rewriter, map( str, self._fields[ name ] ) ) )
+ value = self._input.separator.join( map( self._path_rewriter, map( str, self._fields[ name ] ) ) )
+ log.debug("Returning value %s" % value)
+ return value
def __init__( self, input, value, app, other_values={}, path_rewriter=None ):
self.input = input
self.value = value
self.input.value_label = input.value_to_display_text( value, app )
self._other_values = other_values
+ if path_rewriter: log.debug("Have a path_rewriter for %s" % self.input)
self._path_rewriter = path_rewriter or DEFAULT_PATH_REWRITER
self.fields = self.SelectToolParameterFieldWrapper( input, value, other_values, self._path_rewriter )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment