Skip to content

Commit 48354a0

Browse files
authored
Merge pull request #228 from kr-arjun/job_import_fix
Fix for multi-tasks job imports with tasks having job_cluster_key
2 parents b7f3c3c + 06b8d5f commit 48354a0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dbclient/JobsClient.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ def import_job_configs(self, log_file='jobs.log', acl_file='acl_jobs.log', job_m
138138
wmconstants.WM_IMPORT, wmconstants.JOB_OBJECT)
139139

140140
def adjust_ids_for_cluster(settings): #job_settings or task_settings
141+
"""
142+
The task setting may have existing_cluster_id/new_cluster/job_cluster_key for cluster settings.
143+
The job level setting may have existing_cluster_id/new_cluster for cluster settings.
144+
Adjust cluster settings for existing_cluster_id and new_cluster scenario.
145+
"""
141146
if 'existing_cluster_id' in settings:
142147
old_cid = settings['existing_cluster_id']
143148
# set new cluster id for existing cluster attribute
@@ -148,7 +153,7 @@ def adjust_ids_for_cluster(settings): #job_settings or task_settings
148153
settings['new_cluster'] = self.get_jobs_default_cluster_conf()
149154
else:
150155
settings['existing_cluster_id'] = new_cid
151-
else: # new cluster config
156+
elif 'new_cluster' in settings: # new cluster config
152157
cluster_conf = settings['new_cluster']
153158
if 'policy_id' in cluster_conf:
154159
old_policy_id = cluster_conf['policy_id']

0 commit comments

Comments
 (0)