From c52e879432a7feda778b16978dd06491166d9ad1 Mon Sep 17 00:00:00 2001 From: Aviv Blonder Date: Mon, 8 Jun 2020 14:17:29 +0300 Subject: [PATCH] fix issue with white spaces in artifacts names Added a parsing for the artifact's name in order to avoid this error when the artficat name has a white space: http.client.InvalidURL: URL can't contain control characters. '/artifactory/generic-local/file with space.jar' (found at least ' ') --- filestoreIntegrity/filestoreIntegrity.py | 1 + 1 file changed, 1 insertion(+) diff --git a/filestoreIntegrity/filestoreIntegrity.py b/filestoreIntegrity/filestoreIntegrity.py index 7db6d15..0920fd6 100755 --- a/filestoreIntegrity/filestoreIntegrity.py +++ b/filestoreIntegrity/filestoreIntegrity.py @@ -51,6 +51,7 @@ def getArtifactList(conn, repo): # request an artifact, and return a summary of the artifact if the response code # wasn't 200 or 404 def checkArtifact(conn, repo, artif): + artif = urllib.parse.quote(artif) stat, msg = runRequest(conn, '/{}{}'.format(repo, artif), skipmsg=True) if stat in (200, 404): return None return '[{} {}] {}{}'.format(stat, msg, repo, artif)