1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/4241eff3f67c/ Changeset: 4241eff3f67c User: dan Date: 2013-12-12 23:09:29 Summary: When setting external metadata using _handle_metadata_externally (e.g. local and lwr runners) use the requirments of the set metadata tool to determine dependencies. Resolves issue seen with missing samtools command when samtools is not in the path, but has been installed with the dependency system. Affected #: 4 files diff -r db9256a668eb13072231de605ca74e6c9372a467 -r 4241eff3f67c3d42fe51564c52aafabf65cc6130 lib/galaxy/datatypes/registry.py --- a/lib/galaxy/datatypes/registry.py +++ b/lib/galaxy/datatypes/registry.py @@ -598,6 +598,9 @@ tool_xml_text = """ <tool id="__SET_METADATA__" name="Set External Metadata" version="1.0.1" tool_type="set_metadata"><type class="SetMetadataTool" module="galaxy.tools"/> + <requirements> + <requirement type="package">samtools</requirement> + </requirements><action module="galaxy.tools.actions.metadata" class="SetMetadataToolAction"/><command>$__SET_EXTERNAL_METADATA_COMMAND_LINE__</command><inputs> diff -r db9256a668eb13072231de605ca74e6c9372a467 -r 4241eff3f67c3d42fe51564c52aafabf65cc6130 lib/galaxy/jobs/runners/__init__.py --- a/lib/galaxy/jobs/runners/__init__.py +++ b/lib/galaxy/jobs/runners/__init__.py @@ -198,7 +198,7 @@ log.exception( "from_work_dir specified a location not in the working directory: %s, %s" % ( source_file, job_wrapper.working_directory ) ) return output_pairs - def _handle_metadata_externally(self, job_wrapper): + def _handle_metadata_externally( self, job_wrapper, resolve_requirements=False ): """ Set metadata externally. Used by the local and lwr job runners where this shouldn't be attached to command-line to execute. @@ -213,6 +213,12 @@ #we don't want to overwrite metadata that was copied over in init_meta(), as per established behavior kwds={ 'overwrite' : False } ) log.debug( 'executing external set_meta script for job %d: %s' % ( job_wrapper.job_id, external_metadata_script ) ) + if resolve_requirements: + dependency_shell_commands = self.app.datatypes_registry.set_external_metadata_tool.build_dependency_shell_commands() + if dependency_shell_commands: + if isinstance( dependency_shell_commands, list ): + dependency_shell_commands = "&&".join( dependency_shell_commands ) + external_metadata_script = "%s&&%s" % ( dependency_shell_commands, external_metadata_script ) external_metadata_proc = subprocess.Popen( args=external_metadata_script, shell=True, env=os.environ, diff -r db9256a668eb13072231de605ca74e6c9372a467 -r 4241eff3f67c3d42fe51564c52aafabf65cc6130 lib/galaxy/jobs/runners/local.py --- a/lib/galaxy/jobs/runners/local.py +++ b/lib/galaxy/jobs/runners/local.py @@ -110,7 +110,7 @@ job_wrapper.fail( "failure running job", exception=True ) log.exception("failure running job %d" % job_wrapper.job_id) return - self._handle_metadata_externally( job_wrapper ) + self._handle_metadata_externally( job_wrapper, resolve_requirements=True ) # Finish the job! try: job_wrapper.finish( stdout, stderr, exit_code ) diff -r db9256a668eb13072231de605ca74e6c9372a467 -r 4241eff3f67c3d42fe51564c52aafabf65cc6130 lib/galaxy/jobs/runners/lwr.py --- a/lib/galaxy/jobs/runners/lwr.py +++ b/lib/galaxy/jobs/runners/lwr.py @@ -204,7 +204,7 @@ log.exception("failure running job %d" % job_wrapper.job_id) return if not LwrJobRunner.__remote_metadata( client ): - self._handle_metadata_externally( job_wrapper ) + self._handle_metadata_externally( job_wrapper, resolve_requirements=True ) # Finish the job try: job_wrapper.finish( stdout, stderr ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.