aboutsummaryrefslogtreecommitdiffstats
path: root/tech-support/labels/gondul.py
diff options
context:
space:
mode:
authorHåkon Solbjørg <hakon@solbj.org>2023-04-03 09:55:11 +0200
committerHåkon Solbjørg <hakon@solbj.org>2023-04-03 09:55:44 +0200
commit1e83fed0a29559bfb019b93101a368d4606e7d98 (patch)
treed087956ab5dadc292d23d0aa618b0c46cf8c870b /tech-support/labels/gondul.py
parent47de4a8b6c75422d9c5f7f0ab79b84139651b5d8 (diff)
feat(labler): Update to tg23 syntax
Diffstat (limited to 'tech-support/labels/gondul.py')
-rw-r--r--tech-support/labels/gondul.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tech-support/labels/gondul.py b/tech-support/labels/gondul.py
index 74c1a23..c9fc538 100644
--- a/tech-support/labels/gondul.py
+++ b/tech-support/labels/gondul.py
@@ -7,7 +7,7 @@ import urllib.request
GONDUL_USERNAME = os.getenv("GONDUL_USERNAME", "")
GONDUL_PASSWORD = os.getenv("GONDUL_PASSWORD", "")
-GONDUL_API = os.getenv("GONDUL_API", "https://tg18.gondul.gathering.org/api")
+GONDUL_API = os.getenv("GONDUL_API", "https://gondul.tg23.gathering.org/api")
GONDUL_SWITCHES_ENDPOINT = os.getenv(
"GONDUL_SWITCHES_ENDPOINT", "/public/switches")
@@ -40,7 +40,7 @@ def _do_switches_request(
return switches
-def _match_switches(switches, match="^e(.*)"):
+def _match_switches(switches, match="^e([0-9]+-[0-9]+)"):
pattern = re.compile(match)
included_switches = []
@@ -61,7 +61,7 @@ def _sort_switches(switches):
return sorted(switches, key=lambda x: (int(x[1:].split("-")[0]), x.split("-")[1]))
-def fetch_gondul_switches(api=None, endpoint=None, username=None, password=None, match="^e(.*)"):
+def fetch_gondul_switches(api=None, endpoint=None, username=None, password=None, match="^e([0-9]+-[0-9]+)"):
# Use provided arg instead of environment variable if defined.
_api = api if api is not None else GONDUL_API
_endpoint = endpoint if endpoint is not None else GONDUL_SWITCHES_ENDPOINT