[elbe-devel] [PATCH 6/7] elbepack: efilesystem: exit chroot through exitstack

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Dec 17 13:24:29 CET 2024


Invoke leave_chroot() from the exitstack like all other cleanup
functions for uniform error management.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/efilesystem.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index fc6fecd341769196c34278e8a40ba5c72a6082a3..171ff939629b3681a43efba9efc7547484682a25 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -363,7 +363,8 @@ class ChRootFilesystem(ElbeFilesystem):
 
     def __exit__(self, typ, value, traceback):
         if self.inchroot:
-            self.leave_chroot()
+            self._exitstack.callback(self.leave_chroot)
+
         self._exitstack.__exit__(typ, value, traceback)
 
     def end_excursion(self, origin):

-- 
2.47.1



More information about the elbe-devel mailing list