Skip to content

Commit

Permalink
Merge pull request #94 from felix5572/master
Browse files Browse the repository at this point in the history
support wildcard match for local_context upload files
  • Loading branch information
felix5572 committed Jul 9, 2021
2 parents 3e26d01 + 697066c commit 09024ec
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions dpdispatcher/local_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,17 @@ def upload(self, submission):
remote_job = os.path.join(self.remote_root, ii.task_work_path)
os.makedirs(remote_job, exist_ok = True)
os.chdir(remote_job)
for jj in ii.forward_files :

file_list = []
for kk in ii.forward_files:
abs_file_list = glob(os.path.join(local_job, kk))
if not abs_file_list:
os.chdir(cwd)
raise RuntimeError('cannot find upload file ' + os.path.join(local_job, kk))
rel_file_list = [os.path.relpath(ii, start=local_job) for ii in abs_file_list]
file_list.extend(rel_file_list)

for jj in file_list:
if not os.path.exists(os.path.join(local_job, jj)):
os.chdir(cwd)
raise RuntimeError('cannot find upload file ' + os.path.join(local_job, jj))
Expand All @@ -139,7 +149,17 @@ def upload(self, submission):
remote_job = self.remote_root
# os.makedirs(remote_job, exist_ok = True)
os.chdir(remote_job)
for jj in submission.forward_common_files :

file_list = []
for kk in submission.forward_common_files:
abs_file_list = glob(os.path.join(local_job, kk))
if not abs_file_list:
os.chdir(cwd)
raise RuntimeError('cannot find upload file ' + os.path.join(local_job, kk))
rel_file_list = [os.path.relpath(ii, start=local_job) for ii in abs_file_list]
file_list.extend(rel_file_list)

for jj in file_list:
if not os.path.exists(os.path.join(local_job, jj)):
os.chdir(cwd)
raise RuntimeError('cannot find upload file ' + os.path.join(local_job, jj))
Expand Down

0 comments on commit 09024ec

Please sign in to comment.