Skip to content

Commit

Permalink
Merge pull request #3165 from radical-cybertools/hotfix/mkdir
Browse files Browse the repository at this point in the history
Hotfix/mkdir
  • Loading branch information
andre-merzky authored Apr 10, 2024
2 parents 659811c + 285b223 commit d849aef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 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 Down
7 changes: 7 additions & 0 deletions src/radical/pilot/agent/staging_output/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,13 @@ 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:
shutil.copytree(src.path, tgt.path)
Expand Down

0 comments on commit d849aef

Please sign in to comment.