Skip to content

Commit

Permalink
fix the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-merzky committed Apr 10, 2024
1 parent b74bed2 commit 285b223
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/radical/pilot/agent/staging_input/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ def _handle_task(self, task, actionables):
if action in [rpc.COPY, rpc.LINK, rpc.MOVE]:
assert src.schema == 'file', 'staging src expected as file://'

# backend will take care of dir creation - but we do it manually
# for local ops (copy, link, move)
# implicitly create target dir if needed - but only for local ops
if action != rpc.TRANSFER:
tgtdir = os.path.dirname(tgt.path)
if tgtdir != task_sandbox.path:
Expand All @@ -191,7 +190,6 @@ def _handle_task(self, task, actionables):

if action == rpc.COPY:
try:
ru.rec_makedir(os.path.dirname(tgt.path))
shutil.copytree(src.path, tgt.path)
except OSError as exc:
if exc.errno == errno.ENOTDIR:
Expand Down
8 changes: 7 additions & 1 deletion src/radical/pilot/agent/staging_output/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,15 @@ def _handle_task_staging(self, task, actionables):
if action in [rpc.COPY, rpc.LINK, rpc.MOVE]:
assert tgt.schema == 'file', 'staging tgt expected as file://'

# implicitly create target dir if needed - but only for local ops
if action != rpc.TRANSFER:
tgtdir = os.path.dirname(tgt.path)
if tgtdir != task_sandbox.path:
self._log.debug("mkdir %s", tgtdir)
ru.rec_makedir(tgtdir)

if action == rpc.COPY:
try:
ru.rec_makedir(os.path.dirname(tgt.path))
shutil.copytree(src.path, tgt.path)
except OSError as exc:
if exc.errno == errno.ENOTDIR:
Expand Down

0 comments on commit 285b223

Please sign in to comment.