[elbe-devel] [PATCH 20/21] elbepack: soapclient: make set_pdebuild a method on ElbeSoapClient

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Aug 6 11:18:18 CEST 2024


This is useful functionality that should be usable without going through
"elbe control".
Make it a library function that can be called from other parts of elbe
and call it from "elbe control".

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/commands/control.py | 4 +---
 elbepack/soapclient.py       | 5 +++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/elbepack/commands/control.py b/elbepack/commands/control.py
index 4863125572ef..539b69b6fdcc 100644
--- a/elbepack/commands/control.py
+++ b/elbepack/commands/control.py
@@ -174,9 +174,7 @@ def _wait_busy(client, args):
 @_add_project_dir_argument
 @add_argument('cdrom_file')
 def _set_cdrom(client, args):
-    client.service.start_cdrom(args.project_dir)
-    client.upload_file(client.service.append_cdrom, args.project_dir, args.cdrom_file)
-    client.service.finish_cdrom(args.project_dir)
+    client.set_cdrom(args.project_dir, args.cdrom_file)
 
 
 @_add_project_dir_argument
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index ea476f3f6456..076df8903701 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -220,6 +220,11 @@ class ElbeSoapClient:
         self.upload_file(self.service.append_pdebuild, builddir, pdebuild_file)
         self.service.finish_pdebuild(builddir, profile, cross)
 
+    def set_cdrom(self, builddir, cdrom_file):
+        self.service.start_cdrom(builddir)
+        self.upload_file(self.service.append_cdrom, builddir, cdrom_file)
+        self.service.finish_cdrom(builddir)
+
     def get_files(self, builddir, outdir, *, pbuilder_only=False, wildcard=None):
         files = self.service.get_files(builddir)
 

-- 
2.46.0



More information about the elbe-devel mailing list