From 4862d1bac1d4aaf2eb6910116bbbb4997218ce00 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Mon, 18 Mar 2024 12:49:17 -0500 Subject: [PATCH] Fix issue #758. --- flow/project.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/flow/project.py b/flow/project.py index 6948f1a5..7f8dc6a0 100644 --- a/flow/project.py +++ b/flow/project.py @@ -2203,9 +2203,16 @@ def _expand_bundled_jobs(self, scheduler_jobs): bundle_prefix = self._bundle_prefix for job in scheduler_jobs: if job.name().startswith(bundle_prefix): - with open(self._fn_bundle(job.name())) as file: - for line in file: - yield ClusterJob(line.strip(), job.status()) + bundle_name = self._fn_bundle(job.name()) + # Ensure that the bundle exists in this project before yielding + # jobs from it. This check is necessary because scheduler jobs + # with the same prefix could exist, submitted by other + # FlowProjects with the same name from this user or other + # users. See https://github.com/glotzerlab/signac-flow/issues/758 + if os.path.exists(bundle_name): + with open(bundle_name) as file: + for line in file: + yield ClusterJob(line.strip(), job.status()) else: yield job