diff options
author | Stevan Radakovic <stevan.radakovic@linaro.org> | 2016-12-01 15:52:58 +0100 |
---|---|---|
committer | Senthil Kumaran S <senthil.kumaran@linaro.org> | 2016-12-02 05:16:39 +0000 |
commit | 6da61446328677ad9697edc34ef6355f2ad1ed1f (patch) | |
tree | 88c6c0f39d77bed72a30df5a5a7965fc477a4eb6 /lava_tool | |
parent | 35cd78ebfc012be2702ac5c3507f837298532638 (diff) |
Add job link on submission and resubmission.
https://projects.linaro.org/browse/LAVA-539
Change-Id: I2b290ef301185bf78ba6c5b2f5914b5b53cf7791
Reviewed-on: https://review.linaro.org/16006
Reviewed-by: lava-bot <lava-bot@linaro.org>
Reviewed-by: Senthil Kumaran S <senthil.kumaran@linaro.org>
Diffstat (limited to 'lava_tool')
-rw-r--r-- | lava_tool/authtoken.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lava_tool/authtoken.py b/lava_tool/authtoken.py index c6d0258..a2abd6a 100644 --- a/lava_tool/authtoken.py +++ b/lava_tool/authtoken.py @@ -119,6 +119,20 @@ def split_xmlrpc_url(url): return username, token, userless_uri +def get_server_url(auth_backend, server): + # Get resolved url of the server based on authentication backend. + + user, token, host = split_xmlrpc_url(server) + try: + host, _ = auth_backend.resolve_shortcuts(host, user) + except EndpointNotFoundError as e: + raise LavaCommandError(e) + except UsernameNotFoundError as e: + raise LavaCommandError(e) + + return host + + class AuthBackend(object): def add_token(self, username, endpoint_url, token, user_shortcut=None, |