Skip to content

Commit

Permalink
Merge pull request #1129 from SpiNNakerManchester/allow_missing_beare…
Browse files Browse the repository at this point in the history
…r_token

Allow missing bearer token to mean not in collab
  • Loading branch information
Christian-B authored Oct 11, 2023
2 parents 98ac6e9 + 3c3a664 commit f997161
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions spinn_front_end_common/interface/abstract_spinnaker_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,16 @@ def __group_collab_or_job(self):
cwd = os.getcwd()
match_obj = SHARED_PATH.match(cwd)
if match_obj:
return self.__get_collab_id_from_folder(
collab = self.__get_collab_id_from_folder(
match_obj.group(SHARED_GROUP))
if collab is not None:
return collab
match_obj = SHARED_WITH_PATH.match(cwd)
if match_obj:
return self.__get_collab_id_from_folder(
collab = self.__get_collab_id_from_folder(
match_obj.group(SHARED_WITH_GROUP))
if collab is not None:
return collab

# Try to use the config to get a group
group = get_config_str_or_none("Machine", "spalloc_group")
Expand All @@ -315,7 +319,10 @@ def __get_collab_id_from_folder(self, folder):
""" Currently hacky way to get the EBRAINS collab id from the
drive folder, replicated from the NMPI collab template.
"""
ebrains_drive_client = ebrains_drive.connect(token=self.__bearer_token)
token = self.__bearer_token
if token is None:
return None
ebrains_drive_client = ebrains_drive.connect(token=token)
repo_by_title = ebrains_drive_client.repos.get_repos_by_name(folder)
if len(repo_by_title) != 1:
logger.warning(f"The repository for collab {folder} could not be"
Expand Down

0 comments on commit f997161

Please sign in to comment.