[elbe-devel] [PATCH 01/22] elbepack: projectmanager: split out busy check
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Wed Aug 14 15:29:15 CEST 2024
This test will be used by other methods, too.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/projectmanager.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/elbepack/projectmanager.py b/elbepack/projectmanager.py
index e771acafd26a..8bb8aa8d3ee6 100644
--- a/elbepack/projectmanager.py
+++ b/elbepack/projectmanager.py
@@ -291,11 +291,14 @@ class ProjectManager:
ep = self.userid2project[userid]
if not allow_busy:
- if self.db.is_busy(ep.builddir):
- raise InvalidState(f'project {ep.builddir} is busy')
+ self._assert_not_busy(ep)
return ep
+ def _assert_not_busy(self, ep):
+ if self.db.is_busy(ep.builddir):
+ raise InvalidState(f'project {ep.builddir} is busy')
+
def _close_current_project(self, userid):
# Must be called with self.lock held
--
2.46.0
More information about the elbe-devel
mailing list