Skip to content

Commit

Permalink
Merge pull request #1910 from mvdbeek/fix_not_an_error_1
Browse files Browse the repository at this point in the history
do not assume toolshed to be on URL root
  • Loading branch information
martenson committed Mar 11, 2016
2 parents 8423fe7 + 3476c7f commit 957a8ff
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions lib/galaxy/tools/toolbox/base.py
Expand Up @@ -558,20 +558,22 @@ def _load_tool_tag_set( self, item, panel_dict, integrated_panel_dict, tool_path
# Backward compatibility issue - the tag used to be named 'changeset_revision'.
installed_changeset_revision_elem = item.elem.find( "changeset_revision" )
installed_changeset_revision = installed_changeset_revision_elem.text
try:
splitted_path = path.split('/')
assert splitted_path[0] == tool_shed
assert splitted_path[2] == repository_owner
assert splitted_path[3] == repository_name
if splitted_path[4] != installed_changeset_revision:
# This can happen if the Tool Shed repository has been
# updated to a new revision and the installed_changeset_revision
# element in shed_tool_conf.xml file has been updated too
log.debug("The installed_changeset_revision for tool %s is %s, using %s instead", path, installed_changeset_revision, splitted_path[4])
installed_changeset_revision = splitted_path[4]
except Exception as e:
log.debug("Error while loading tool %s : %s", path, e)
pass
if "/repos/" in path: # The only time "/repos/" should not be in path is during testing!
try:
tool_shed_path, reduced_path = path.split('/repos/', 1)
splitted_path = reduced_path.split('/')
assert tool_shed_path == tool_shed
assert splitted_path[0] == repository_owner
assert splitted_path[1] == repository_name
if splitted_path[2] != installed_changeset_revision:
# This can happen if the Tool Shed repository has been
# updated to a new revision and the installed_changeset_revision
# element in shed_tool_conf.xml file has been updated too
log.debug("The installed_changeset_revision for tool %s is %s, using %s instead", path, installed_changeset_revision, splitted_path[2])
installed_changeset_revision = splitted_path[2]
except AssertionError:
log.debug("Error while loading tool %s", path)
pass
tool_shed_repository = self._get_tool_shed_repository( tool_shed,
repository_name,
repository_owner,
Expand Down

0 comments on commit 957a8ff

Please sign in to comment.