Skip to content
Snippets Groups Projects

add log msgs

Merged Ihli, Monica requested to merge dev into prod
1 file
+ 5
4
Compare changes
  • Side-by-side
  • Inline
+ 5
4
@@ -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
Loading