Skip to content

Commit ac6a5ac

Browse files
authoredMar 21, 2024··
Ensure that bundle exists in a project before yielding cluster jobs from it (#832)
1 parent 525ec4c commit ac6a5ac

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed
 

‎flow/project.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -2203,9 +2203,16 @@ def _expand_bundled_jobs(self, scheduler_jobs):
22032203
bundle_prefix = self._bundle_prefix
22042204
for job in scheduler_jobs:
22052205
if job.name().startswith(bundle_prefix):
2206-
with open(self._fn_bundle(job.name())) as file:
2207-
for line in file:
2208-
yield ClusterJob(line.strip(), job.status())
2206+
bundle_name = self._fn_bundle(job.name())
2207+
# Ensure that the bundle exists in this project before yielding
2208+
# jobs from it. This check is necessary because scheduler jobs
2209+
# with the same prefix could exist, submitted by other
2210+
# FlowProjects with the same name from this user or other
2211+
# users. See https://github.com/glotzerlab/signac-flow/issues/758
2212+
if os.path.exists(bundle_name):
2213+
with open(bundle_name) as file:
2214+
for line in file:
2215+
yield ClusterJob(line.strip(), job.status())
22092216
else:
22102217
yield job
22112218

0 commit comments

Comments
 (0)
Please sign in to comment.