Skip to content

Commit 09b0605

Browse files
authored
Improve behavior of base_url setting in management interfaces (#58)
* Make base URL more dynamic
1 parent c90e412 commit 09b0605

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

singlestoredb/management/manager.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def __init__(
6262
)
6363
if not new_access_token:
6464
raise ManagementError(msg='No management token was configured.')
65+
6566
self._is_jwt = not access_token and new_access_token and is_jwt(new_access_token)
6667
self._sess = requests.Session()
6768
self._sess.headers.update({
@@ -70,10 +71,14 @@ def __init__(
7071
'Accept': 'application/json',
7172
'User-Agent': f'SingleStoreDB-Python/{client_version}',
7273
})
74+
7375
self._base_url = urljoin(
74-
base_url or type(self).default_base_url,
76+
base_url
77+
or config.get_option('management.base_url')
78+
or type(self).default_base_url,
7579
version or type(self).default_version,
7680
) + '/'
81+
7782
self._params: Dict[str, str] = {}
7883
if organization_id:
7984
self._params['organizationID'] = organization_id

0 commit comments

Comments
 (0)