Skip to content

Commit

Permalink
Merge pull request #228 from kr-arjun/job_import_fix
Browse files Browse the repository at this point in the history
Fix for multi-tasks job imports with tasks having job_cluster_key
  • Loading branch information
gregwood-db authored Jan 11, 2023
2 parents b7f3c3c + 06b8d5f commit 48354a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dbclient/JobsClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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']
Expand Down

0 comments on commit 48354a0

Please sign in to comment.