summaryrefslogtreecommitdiff
path: root/wrappers/python/eduvpn_common/main.py
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-07-10 14:39:34 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-07-17 14:00:03 +0000
commita1879195a727d7b90347ed11f86d85fac6541df7 (patch)
treeef19423671009552181f759b4a9162e7d91bf82a /wrappers/python/eduvpn_common/main.py
parent7f8af5845ddec1816f93a2cb013f0818c19caab3 (diff)
Client + Discovery: Fetch dscovery at startup using DiscoveryStartup
With a manager that locks and copies such that no race conditions happen
Diffstat (limited to 'wrappers/python/eduvpn_common/main.py')
-rw-r--r--wrappers/python/eduvpn_common/main.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/wrappers/python/eduvpn_common/main.py b/wrappers/python/eduvpn_common/main.py
index cb81e53..8c556e9 100644
--- a/wrappers/python/eduvpn_common/main.py
+++ b/wrappers/python/eduvpn_common/main.py
@@ -10,6 +10,7 @@ from eduvpn_common.types import (
ProxyReady,
ProxySetup,
ReadRxBytes,
+ RefreshList,
TokenGetter,
TokenSetter,
VPNStateChange,
@@ -180,12 +181,14 @@ class EduVPN(object):
def get_disco_organizations(self, search="") -> str:
orgs, _ = self.go_cookie_function(self.lib.DiscoOrganizations, search)
- # TODO: Log error
+ # We don't log anything here as we want to return a result and we don't want to throw here
+ # we already log for errors in common
return orgs
def get_disco_servers(self, search="") -> str:
servers, _ = self.go_cookie_function(self.lib.DiscoServers, search)
- # TODO: Log error
+ # We don't log anything here as we want to return a result and we don't want to throw here
+ # we already log for errors in common
return servers
def get_servers(self) -> str:
@@ -298,6 +301,12 @@ class EduVPN(object):
if location_err:
forwardError(location_err)
+ def discovery_startup(self, refresh: RefreshList) -> None:
+ refresh_err = self.go_function(self.lib.DiscoveryStartup, refresh)
+
+ if refresh_err:
+ forwardError(refresh_err)
+
def set_token_handler(self, getter: Callable, setter: Callable) -> None:
self.token_setter = setter
self.token_getter = getter