]> git.ipfire.org Git - ipfire.org.git/commitdiff
Remove mirror list generation from webapp
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 29 Mar 2018 19:13:51 +0000 (20:13 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 29 Mar 2018 19:13:51 +0000 (20:13 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
webapp/__init__.py
webapp/backend/mirrors.py
webapp/handlers_mirrors.py

index 30c94d14671dd4e786796660c57a41af306d36d0..6dafc3e6e85d3bad6b4708c6c25981b95203f434 100644 (file)
@@ -142,7 +142,6 @@ class Application(tornado.web.Application):
                self.add_handlers(r"mirrors(\.dev)?\.ipfire\.org", [
                        (r"/", MirrorIndexHandler),
                        (r"/mirror/(.*)", MirrorItemHandler),
-                       (r"/lists/pakfire2", MirrorListPakfire2Handler),
                ] + static_handlers)
 
                # planet.ipfire.org
index 042c0b6177072b8001bc1dea4fcf61d6431b6041..60bd7793f997efbc244883740bf86bc546ccd69f 100644 (file)
@@ -99,17 +99,6 @@ class Mirrors(Object):
 
                return MirrorSet(self.backend, sorted(mirrors))
 
-       def get_all_up(self):
-               res = self.db.query("SELECT * FROM mirrors WHERE enabled = %s AND state = %s \
-                       ORDER BY hostname", True, "UP")
-
-               mirrors = []
-               for row in res:
-                       m = Mirror(self.backend, row.id, row)
-                       mirrors.append(m)
-
-               return MirrorSet(self.backend, mirrors)
-
        def get_by_hostname(self, hostname):
                ret = self.db.get("SELECT * FROM mirrors WHERE hostname = %s", hostname)
 
index 75a251ac54779d2d9283883299445e0ed689622e..6ccaf6a5f3c1c4f29a9d5a238f092756a032f6e5 100644 (file)
@@ -55,47 +55,3 @@ class MirrorAllHandler(BaseHandler):
 class MirrorDetailHandler(BaseHandler):
        def get(self, id):
                self.render("download-mirror-detail.html", mirror=self.mirrors.get(id))
-
-
-class MirrorListPakfire2Handler(BaseHandler):
-       def get(self):
-               suffix = self.get_argument("suffix", "")
-               development = self.get_argument("development", None)
-
-               self.set_header("Content-Type", "text/plain")
-
-               # Get all mirror servers that are currently up.
-               mirrors = self.mirrors.get_all_up()
-
-               lines = []
-               for m in mirrors:
-                       if not m.mirrorlist:
-                               continue
-
-                       # Skip all non-development mirrors
-                       # if we run in development mode.
-                       if development and not m.development:
-                               continue
-
-                       path = [m.path, "pakfire2"]
-
-                       if suffix:
-                               path.append(suffix)
-
-                       path = "/".join(path)
-
-                       # Remove double slashes.
-                       path = path.replace("//", "/")
-
-                       # Remove leading slash.
-                       if path.startswith("/"):
-                               path = path[1:]
-
-                       # Remove trailing slash.
-                       if path.endswith("/"):
-                               path = path[:-1]
-
-                       line = ("HTTP", m.hostname, path, "")
-                       lines.append(";".join(line))
-
-               self.finish("\r\n".join(lines))