Sort domains by hostname
This commit is contained in:
parent
e8a8cd1dce
commit
6cc1575565
1 changed files with 2 additions and 1 deletions
|
@ -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__":
|
||||
|
|
Reference in a new issue