Skip to content
Snippets Groups Projects
Commit dcadd950 authored by Jörn Künsemöller's avatar Jörn Künsemöller
Browse files

TMSS-453: small fix

parent c16b21e6
No related branches found
No related tags found
3 merge requests!634WIP: COBALT commissioning delta,!481Draft: SW-971 SW-973 SW-975: Various fixes to build LOFAR correctly.,!476Resolve TMSS-453
......@@ -4,6 +4,7 @@ import cachetools.func
import os
import json
import re
from lofar.sas.tmss.tmss.exceptions import TMSSException
logger = logging.Logger(__name__)
......@@ -26,7 +27,7 @@ class KeycloakAdminAPISession(requests.Session):
logger.info('Obtained Keycloak API token')
return token
else:
raise Exception('Keycloak admin API token could not be obtained: %s' % response.text)
raise TMSSException('Keycloak admin API token could not be obtained: %s' % response.text)
def get(self, *args, **kwargs):
token = self.get_token()
......@@ -36,7 +37,7 @@ class KeycloakAdminAPISession(requests.Session):
if response.status_code == 200:
return json.loads(response.content.decode('utf-8'))
else:
raise Exception('Keycloak admin API query failed: %s' % response.text)
raise TMSSException('Keycloak admin API query failed: %s' % response.text)
def get_users_by_role_in_project(role, project):
......@@ -82,7 +83,7 @@ def get_project_persons():
unmappable_user_fixed = re.sub(' +', ' ', unmappable_user_fixed)
if unmappable_user_fixed in user_map:
users.append(user_map[unmappable_user_fixed])
mapped_users.append(user_map[unmappable_user_fixed])
else:
logger.warning("Could not match Keycloak user reference '%s' to a known user" % unmappable_user)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment