[elbe-devel] [PATCH 11/18] elbepack: initvm: call wait_busy() directly

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Aug 13 13:15:41 CEST 2024


Instead of going through "elbe control", call the wait_busy()
method directly. This reuses existing connections and improves the error
reporting.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/initvmaction.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index a4c44db4ca02..75940f16120a 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -125,8 +125,9 @@ def _submit_and_dl_result(control, xmlfile, cdrom, args):
     print('Build started, waiting till it finishes')
 
     try:
-        run_elbe(['control', 'wait_busy', prjdir], check=True)
-    except subprocess.CalledProcessError as e:
+        for msg in control.wait_busy(prjdir):
+            print(msg)
+    except Exception as e:
         raise with_cli_details(e, 133, textwrap.dedent(f"""
             elbe control wait_busy Failed
 
@@ -147,8 +148,9 @@ def _submit_and_dl_result(control, xmlfile, cdrom, args):
         print('SDK Build started, waiting till it finishes')
 
         try:
-            run_elbe(['control', 'wait_busy', prjdir], check=True)
-        except subprocess.CalledProcessError:
+            for msg in control.wait_busy(prjdir):
+                print(msg)
+        except Exception:
             print('elbe control wait_busy Failed, while waiting for the SDK',
                   file=sys.stderr)
             print('', file=sys.stderr)

-- 
2.46.0



More information about the elbe-devel mailing list