Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
import datetime
import functools
import logging
+import os.path
import random
import socket
import tornado.netutil
def url(self):
return self.make_url()
- def make_url(self, path=""):
+ def make_url(self, *paths):
url = "https://%s%s/" % (
self.hostname,
self.path
)
+ # Merge the path together
+ path = os.path.join(*paths)
+
+ # Remove any leading slashes
if path.startswith("/"):
path = path[1:]
"version" : 1,
"mirrors" : [
{
- "url" : urllib.parse.urljoin(
- mirror.url, os.path.join("repos", repo.path, arch)),
+ "url" : mirror.make_url("repos", repo.path, arch),
"location" : mirror.country_code,
}
for mirror in await self.backend.mirrors.get_mirrors_for_address(self.current_address)