diff --git a/mig/server/grid_script.py b/mig/server/grid_script.py index b48078f00..739d0fdb7 100755 --- a/mig/server/grid_script.py +++ b/mig/server/grid_script.py @@ -4,7 +4,7 @@ # --- BEGIN_HEADER --- # # grid_script - the core job handling daemon on a MiG server -# Copyright (C) 2003-2023 The MiG Project lead by Brian Vinter +# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH # # This file is part of MiG. # @@ -20,7 +20,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. # # -- END_HEADER --- # @@ -693,11 +694,9 @@ def graceful_shutdown(): exe_job = \ executing_queue.get_job_by_id(job_dict['JOB_ID' ]) + # Ignore missing fields + (last_res, last_exe) = ('', '') if exe_job: - - # Ignore missing fields - - (last_res, last_exe) = ('', '') if 'UNIQUE_RESOURCE_NAME' in exe_job: last_res = exe_job['UNIQUE_RESOURCE_NAME'] if 'EXE' in exe_job: @@ -799,7 +798,8 @@ def graceful_shutdown(): vgrids_in_prioritized_order = [] - list_indices = [(last_vgrid + i) % len(exe_vgrids) for i in range(len(exe_vgrids))] + list_indices = [(last_vgrid + i) % len(exe_vgrids) + for i in range(len(exe_vgrids))] for index in list_indices: # replace "" with default_vgrid diff --git a/mig/shared/functionality/autocreate.py b/mig/shared/functionality/autocreate.py index 305691540..3e9e4504a 100644 --- a/mig/shared/functionality/autocreate.py +++ b/mig/shared/functionality/autocreate.py @@ -4,7 +4,7 @@ # --- BEGIN_HEADER --- # # autocreate - auto create user from signed certificate or openid login -# Copyright (C) 2003-2024 The MiG Project lead by Brian Vinter +# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH # # This file is part of MiG. # @@ -20,7 +20,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. # # -- END_HEADER --- # @@ -395,6 +396,11 @@ def main(client_id, user_arguments_dict, environ=None): state = accepted['state'][-1].strip() org = accepted['org'][-1].strip() org_unit = '' + + # NOTE: no tokens involved here + token_issuer = '' + token_audience = '' + # NOTE: leave role and association alone here role = '' association = '' @@ -429,6 +435,10 @@ def main(client_id, user_arguments_dict, environ=None): org_unit = accepted['openid.sreg.ou'][-1].strip() \ or accepted['openid.sreg.organizational_unit'][-1].strip() + # NOTE: no tokens involved here + token_issuer = '' + token_audience = '' + # We may receive multiple roles and associations merged = accepted['openid.sreg.role'] + accepted['openid.sreg.roles'] @@ -469,6 +479,8 @@ def main(client_id, user_arguments_dict, environ=None): # translate to individual args instead in that case. E.g. as in # 'john@doe.org,jd@doe.org' -> ['john@doe.org', 'jd@doe.org'] email = split_comma_concat(accepted['oidc.claim.email'])[-1].strip() + else: + raise ValueError("Unsupported auth type: %r" % auth_type) # We may encounter results without an email, fall back to try plain IDs then if not email: diff --git a/mig/shared/mrslparser.py b/mig/shared/mrslparser.py index 9ca2c6b29..e7d26f08e 100644 --- a/mig/shared/mrslparser.py +++ b/mig/shared/mrslparser.py @@ -4,7 +4,7 @@ # --- BEGIN_HEADER --- # # mrslparser - Parse mRSL job descriptions -# Copyright (C) 2003-2021 The MiG Project lead by Brian Vinter +# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH # # This file is part of MiG. # @@ -20,7 +20,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. # # -- END_HEADER --- # @@ -136,7 +137,7 @@ def parse( if not status: return (False, 'Parse failed (typecheck) %s' % msg) - #logger.debug('check_types updated job dict to: %s' % external_dict) + # logger.debug('check_types updated job dict to: %s' % external_dict) global_dict = {} @@ -375,9 +376,8 @@ def parse( else: before_runt_dict = resource_config['RUNTVERIFICATION'] if re_name not in before_runt_dict: - before_runt_dict[re_name] = [].append(dict_entry) - else: - before_runt_dict[re_name].append(dict_entry) + before_runt_dict[re_name] = [] + before_runt_dict[re_name].append(dict_entry) # save dict with added entry