[elbe-devel] [PATCH 15/18] elbepack: initvm: call get_files() directly

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


Instead of going through "elbe control", call the get_files()
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 | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index 748a6cf3ab48..2274bf1a3c86 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -195,7 +195,9 @@ def _submit_and_dl_result(control, xmlfile, cdrom, args):
         print('')
         print('Listing available files:')
         print('')
-        run_elbe(['control', 'get_files', prjdir], check=True)
+        files = control.get_files(prjdir, None)
+        for file in files:
+            print(f'{file.name}\t{file.description}')
 
         print('')
         print(f'Get Files with: elbe control get_file "{prjdir}" <filename>')
@@ -206,7 +208,9 @@ def _submit_and_dl_result(control, xmlfile, cdrom, args):
 
         print(f'Saving generated Files to {args.outdir}')
 
-        run_elbe(['control', 'get_files', '--output', args.outdir, prjdir], check=True)
+        files = control.get_files(prjdir, args.outdir)
+        for file in files:
+            print(f'{file.name}\t{file.description}')
 
         if not args.keep_files:
             run_elbe(['control', 'del_project', prjdir], check=True)

-- 
2.46.0



More information about the elbe-devel mailing list