From 06b8d5f8859e8e6ad6f1ffb0412ff44dad4e4144 Mon Sep 17 00:00:00 2001 From: kr-arjun Date: Thu, 29 Dec 2022 14:20:01 -0600 Subject: [PATCH] Fix for multi-tasks job imports with tasks having job_cluster_key The multi task jobs' task may have new_cluster/existing_cluster_id/job_cluster_key for cluster setting. This change fixes cluster adjustment logic to handle import failure with tasks having job_cluster_key. --- dbclient/JobsClient.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dbclient/JobsClient.py b/dbclient/JobsClient.py index 86c59b75..a822d880 100644 --- a/dbclient/JobsClient.py +++ b/dbclient/JobsClient.py @@ -138,6 +138,11 @@ def import_job_configs(self, log_file='jobs.log', acl_file='acl_jobs.log', job_m wmconstants.WM_IMPORT, wmconstants.JOB_OBJECT) def adjust_ids_for_cluster(settings): #job_settings or task_settings + """ + The task setting may have existing_cluster_id/new_cluster/job_cluster_key for cluster settings. + The job level setting may have existing_cluster_id/new_cluster for cluster settings. + Adjust cluster settings for existing_cluster_id and new_cluster scenario. + """ if 'existing_cluster_id' in settings: old_cid = settings['existing_cluster_id'] # set new cluster id for existing cluster attribute @@ -148,7 +153,7 @@ def adjust_ids_for_cluster(settings): #job_settings or task_settings settings['new_cluster'] = self.get_jobs_default_cluster_conf() else: settings['existing_cluster_id'] = new_cid - else: # new cluster config + elif 'new_cluster' in settings: # new cluster config cluster_conf = settings['new_cluster'] if 'policy_id' in cluster_conf: old_policy_id = cluster_conf['policy_id']