Skip to contentSkip to conversation

reporters/swatbot: sanitize urls

PATCH New Alexandre Belloni 1 participant 1 message Jun 17, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reporters/swatbot: sanitize urls

When the log name contains a space, the generated URL is not correct. This later also breaks parsing in swatbot. This was triggered by "property changes" and the correct URL is indeed logs/property_changes.

---

This is untested because I don't have the setup handy but, I hope, it is trivial enough to work properly

 reporters/swatbot.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
reporters/swatbot.py +1 -1
index 4a5a04eb1809..41ae762359a0 100644
@@ -202,7 +202,7 @@ class SwatBotURI(object):
             logs = list(logs)
             urls = []
             for l in logs:
-                urls.append('%s/steps/%s/logs/%s' % (build['url'], step_number, l['name']))
+                urls.append('%s/steps/%s/logs/%s' % (build['url'], step_number, l['name'].replace(" ", "_")))
             if urls:
                 urls = " ".join(urls)
             else:
Signature · 1 line
2.31.1