Skip to content

Commit 714cdcb

Browse files
committed
Improve symlink handling
1 parent 17ba254 commit 714cdcb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

docs/examples/slurm-execution/slurm.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,17 @@ def __call__(self):
144144
elif self.config.resume_failed == "skip":
145145
continue
146146
else:
147-
raise ExecutionFailed(
148-
f"{executable.module} <{executable.id})> has previously been executed unsuccessfully. Set `resume_failed` to True, 'new' or 'skip' to handle resubmission."
149-
)
147+
err = f"{executable.module} <{executable.id})> has previously been executed unsuccessfully. Set `resume_failed` to True, 'new' or 'skip' to handle resubmission."
148+
if self.config.dry:
149+
print(err)
150+
else:
151+
raise ExecutionFailed(err)
150152

151153
source_code = Project.get().path()
152154
if self.config.copy_project_source and not self.config.dry:
153155
print("Copy project source code ...")
154156
source_code = self.local_directory(executable.id, "source_code")
155-
cmd = ["rsync", "-a", Project.get().path(""), source_code]
157+
cmd = ["rsync", "-rLptgoD", Project.get().path(""), source_code]
156158
print(" ".join(cmd))
157159
run_and_stream(cmd, check=True)
158160

src/machinable/project.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ def resolve_remotes(self, module: str) -> Optional[Element]:
374374
# copy
375375
shutil.copy(remote[5:], filename)
376376
else:
377-
raise ValueError(f"Unknown remote type for {module}: {remote}")
377+
raise ValueError(
378+
f"Unknown remote type for {module}: {remote} (target file is {filename}"
379+
)
378380

379381
try:
380382
element_class = find_subclass_in_module(

0 commit comments

Comments
 (0)