1
Fork 0

Sort domains by hostname

This commit is contained in:
Jake Howard 2023-08-24 22:03:32 +01:00
parent e8a8cd1dce
commit 6cc1575565
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -2,6 +2,7 @@ import requests
from typing import NamedTuple
import re
import sys
import operator
TRAEFIK_HOST_RE = re.compile(r"Host\(`([a-z0-9\.-]+)`\)")
@ -61,7 +62,7 @@ def main():
routes.extend(get_traefik_routes("http://10.23.1.103:8080", "http://10.23.1.103"))
routes.extend(get_dokku_routes("http://10.23.2.3:8000", "http://10.23.2.3"))
for route in sorted(routes):
for route in sorted(routes, key=operator.attrgetter("hostname")):
print(f"{route.hostname}\t{route.destination}; # {route.name}")
if __name__ == "__main__":