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.
This commit is contained in:
Marius van den Beek
2016-04-05 15:45:06 +02:00
parent 9b7be814b3
commit ab264ebeb4
+2 -2
View File
@@ -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):