From ffce11107d3ba915d190d0b2ba4b301e88a2ed45 Mon Sep 17 00:00:00 2001 From: Serban Constantin Date: Wed, 4 Dec 2019 11:45:31 +0200 Subject: [PATCH] fix get_stat_json using wrong url The artifact upload process fails because when we create the Artifactory Storage API request we duplicate the / between artifactory and api. Let's say we're trying to upload an artifact to http://my-artifactory/artifactory/upload-dest . When we reach get_stat_json and process the url, instead of getting http://my-artifactory/artifactory/api/storage/upload-dest we get http://my-artifactory/artifactory//api/storage/upload-dest This in turn returns a 500 Repo key cannot be empty error and fails the upload. --- artifactory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifactory.py b/artifactory.py index ca5ae0ce..c1eb6c12 100755 --- a/artifactory.py +++ b/artifactory.py @@ -583,7 +583,7 @@ def get_stat_json(self, pathobj): """ url = "/".join( [ - pathobj.drive, + pathobj.drive.rstrip("/"), "api/storage", str(pathobj.relative_to(pathobj.drive)).strip("/"), ]