File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,7 @@ def __init__ (self,
311
311
assert os .path .isabs (remote_root ), f"remote_root must be a abspath"
312
312
self .temp_remote_root = remote_root
313
313
self .remote_profile = remote_profile
314
+ self .remote_root = None
314
315
315
316
# self.job_uuid = None
316
317
self .clean_asynchronously = clean_asynchronously
@@ -378,8 +379,14 @@ def get_job_root(self) :
378
379
def bind_submission (self , submission ):
379
380
self .submission = submission
380
381
self .local_root = pathlib .PurePath (os .path .join (self .temp_local_root , submission .work_base )).as_posix ()
382
+ old_remote_root = self .remote_root
381
383
# self.remote_root = os.path.join(self.temp_remote_root, self.submission.submission_hash, self.submission.work_base )
382
384
self .remote_root = pathlib .PurePath (os .path .join (self .temp_remote_root , self .submission .submission_hash )).as_posix ()
385
+ # move the working directory if remote_root changes
386
+ if old_remote_root is not None and old_remote_root != self .remote_root \
387
+ and self .check_file_exists (old_remote_root ) \
388
+ and not self .check_file_exists (self .remote_root ):
389
+ self .block_checkcall (f"mv { old_remote_root } { self .remote_root } " )
383
390
384
391
sftp = self .ssh_session .ssh .open_sftp ()
385
392
try :
You can’t perform that action at this time.
0 commit comments