Remove trailing / for url paths
authorStavros Sachtouris <saxtouri@admin.grnet.gr>
Tue, 26 Feb 2013 14:50:31 +0000 (16:50 +0200)
committerStavros Sachtouris <saxtouri@admin.grnet.gr>
Tue, 26 Feb 2013 14:50:31 +0000 (16:50 +0200)
kamaki/clients/utils.py

index 63262e9..d9c2bfe 100644 (file)
@@ -91,7 +91,7 @@ def path4url(*args):
         isinstance(arg, str)) else '%s' % arg for arg in args])
     while '//' in r:
         r = r.replace('//', '/')
-    return r
+    return ('/%s' % r.strip('/')) if r else ''
 
 
 def params4url(params):