From ab264ebeb4c0153e7c914df3e3f2c60d6ae149cb Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Tue, 5 Apr 2016 15:45:06 +0200 Subject: [PATCH] Remove version by slicing tool_id before last slash As pointed out by @nsoranzo, this may avoid conflicts when the version string appears more than once in tool_id. --- lib/galaxy/tools/toolbox/lineages/factory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tools/toolbox/lineages/factory.py b/lib/galaxy/tools/toolbox/lineages/factory.py index f3b42ce8516..cc67d45b731 100644 --- a/lib/galaxy/tools/toolbox/lineages/factory.py +++ b/lib/galaxy/tools/toolbox/lineages/factory.py @@ -8,8 +8,8 @@ def remove_version_from_guid( guid ): """ if "/repos/" not in guid: return None - tool_version = guid.split("/")[-1] - return guid.split(tool_version)[0] + last_slash = guid.rfind('/') + return guid[:last_slash] class LineageMap(object):