Skip to content
Snippets Groups Projects
Commit 515a1f4a authored by Ihli, Monica's avatar Ihli, Monica
Browse files

add log msgs

parent 11cfe0cc
No related branches found
No related tags found
1 merge request!18add log msgs
Pipeline #362145 waiting for manual action
......@@ -15,8 +15,9 @@ ARM_LDAP_GID_ATTR = 'gidNumber'
def get_profiles(spawner):
auth_state = yield spawner.user.get_auth_state()
profile_list = []
spawner.log.info("@"*80)
# either internal profile OR science profile, no need for both
spawner.log.info(f"GROUPS: {auth_state['oauth_user']['groups']}")
if 'ace-jupyter-infrastructure' in auth_state['oauth_user']['groups'] or \
'ars-research-adc-users' in auth_state['oauth_user']['groups']:
profile_list.append(profiles.internal_profile)
......@@ -27,7 +28,7 @@ def get_profiles(spawner):
profile_list.append(profiles.educational_profile)
profile_list.append(profiles.default_profile) # everyone gets access
spawner.log.info("@"*80)
return profile_list
......@@ -38,7 +39,7 @@ def get_profiles(spawner):
def set_env(spawner):
auth_state = yield spawner.user.get_auth_state()
spawner.log.info(f"ORIGINAL AUTH STATE: {auth_state}")
spawner.log.info("@"*80+f"\nORIGINAL AUTH STATE: {auth_state}\n"+"@"*80)
spawner.uid = int(auth_state['oauth_user']['uid'])
spawner.run_as_uid = int(auth_state['oauth_user']['uid'])
spawner.gid = int(auth_state['oauth_user']['gid'])
......@@ -55,8 +56,8 @@ def set_env(spawner):
spawner.environment['USER'] = auth_state['oauth_user']['preferred_username']
# This XDG env variable needed to play nice with matplotlib
spawner.environment['XDG_CACHE_HOME'] = f'/home/{spawner.user.name}/.cache/'
spawner.disable_user_config = False
spawner.log.info("@" * 80 + f"\nNEW AUTH STATE: {auth_state}\n" + "@" * 80)
# Because keycloak OIDC service doesn't have the LDAP group GIDs, we have to manually pull this.
# Since Jhub gets the group names, we can use those to get the GIDs to hand to the spawner
......
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