diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-04-06 21:38:43 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-04-06 21:38:43 +0300 |
commit | 5aeef33219103eb5f39bfc0a79ed462f46a12420 (patch) | |
tree | 7fd5f2deb719a8c4ff68bf7eda7ee024006cf986 /ick2/controllerapi.py | |
parent | 63a8c15a46b73232fc2162807eced80e5e2c7296 (diff) | |
download | ick2-5aeef33219103eb5f39bfc0a79ed462f46a12420.tar.gz |
Add: authentication URL to controller /version
Diffstat (limited to 'ick2/controllerapi.py')
-rw-r--r-- | ick2/controllerapi.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py index f7c71f6..9785384 100644 --- a/ick2/controllerapi.py +++ b/ick2/controllerapi.py @@ -23,14 +23,24 @@ class ControllerAPI: self._apis = {} def set_artifact_store_url(self, url): # pragma: no cover - self.find_missing_route('/version') - api = self._apis.get('/version') + self._set_url('set_artifact_store_url', url) + + def set_auth_url(self, url): # pragma: no cover + self._set_url('set_auth_url', url) + + def _set_url(self, what, url): # pragma: no cover + api = self._get_version_api() if api: - api.set_artifact_store_url(url) + method = getattr(api, what) + method(url) ick2.log.log( - 'info', msg_text='Set artifact store url', url=url, + 'info', msg_text='Set url', what=what, url=url, version=api.get_version()) + def _get_version_api(self): # pragma: no cover + self.find_missing_route('/version') + return self._apis.get('/version') + def find_missing_route(self, missing_path): # pragma: no cover apis = { '/version': ick2.VersionAPI, |