[elbe-devel] [PATCH 05/10] elbepack: projectmanager/esoap: stop passing around unused userid

Thomas Weißschuh thomas.weissschuh at linutronix.de
Fri Feb 28 14:59:16 CET 2025


The userid is not used anymore.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/daemons/soap/esoap.py | 36 ++++++++++++++++++------------------
 elbepack/projectmanager.py     | 32 +++++++++++++++-----------------
 2 files changed, 33 insertions(+), 35 deletions(-)

diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index 0d470b27af642abb1a360458668849b2bef6b19f..323fb4e9911da249989878591d1b3acd5248c113 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -110,7 +110,7 @@ class ESoap (ServiceBase):
 
     @rpc(String, String, String, Integer, _returns=Integer)
     @authenticated_uid
-    def upload_file(self, uid, builddir, fname, blob, part):
+    def upload_file(self, builddir, fname, blob, part):
 
         fn = os.path.join(builddir, fname)
         if part == 0:
@@ -140,38 +140,38 @@ class ESoap (ServiceBase):
     @rpc(String)
     @authenticated_uid
     def build_chroot_tarball(self, uid, builddir):
-        self.app.pm.build_chroot_tarball(uid, builddir)
+        self.app.pm.build_chroot_tarball(builddir)
 
     @rpc(String)
     @authenticated_uid
     def build_sysroot(self, uid, builddir):
-        self.app.pm.build_sysroot(uid, builddir)
+        self.app.pm.build_sysroot(builddir)
 
     @rpc(String)
     @authenticated_uid
     def build_sdk(self, uid, builddir):
-        self.app.pm.build_sdk(uid, builddir)
+        self.app.pm.build_sdk(builddir)
 
     @rpc(String, Boolean, Boolean)
     @authenticated_uid
     def build_cdroms(self, uid, builddir, build_bin, build_src):
-        self.app.pm.build_cdroms(uid, builddir, build_bin, build_src)
+        self.app.pm.build_cdroms(builddir, build_bin, build_src)
 
     @rpc(String, Boolean, Boolean, Boolean)
     @authenticated_uid
     def build(self, uid, builddir, build_bin, build_src, skip_pbuilder):
 
-        self.app.pm.build_project(uid, builddir, build_bin, build_src, skip_pbuilder)
+        self.app.pm.build_project(builddir, build_bin, build_src, skip_pbuilder)
 
     @rpc(String, Boolean, Boolean, String)
     @authenticated_uid
     def build_pbuilder(self, uid, builddir, cross, noccache, ccachesize):
-        self.app.pm.build_pbuilder(uid, builddir, cross, noccache, ccachesize)
+        self.app.pm.build_pbuilder(builddir, cross, noccache, ccachesize)
 
     @rpc(String)
     @authenticated_uid
     def update_pbuilder(self, uid, builddir):
-        self.app.pm.update_pbuilder(uid, builddir)
+        self.app.pm.update_pbuilder(builddir)
 
     @rpc(String)
     @authenticated_uid
@@ -195,7 +195,7 @@ class ESoap (ServiceBase):
     @rpc(String)
     @authenticated_uid
     def finish_cdrom(self, uid, builddir):
-        self.app.pm.set_upload_cdrom(uid, builddir, ValidationMode.NO_CHECK)
+        self.app.pm.set_upload_cdrom(builddir, ValidationMode.NO_CHECK)
 
     @rpc(String)
     @authenticated_uid
@@ -219,17 +219,17 @@ class ESoap (ServiceBase):
     @rpc(String, String, Boolean)
     @authenticated_uid
     def finish_pdebuild(self, uid, builddir, profile, cross):
-        self.app.pm.build_pdebuild(uid, builddir, profile, cross)
+        self.app.pm.build_pdebuild(builddir, profile, cross)
 
     @rpc(String, String)
     @authenticated_uid
     def start_upload_orig(self, uid, builddir, fname):
-        self.app.pm.set_orig_fname(uid, builddir, fname)
+        self.app.pm.set_orig_fname(builddir, fname)
 
     @rpc(String, String)
     @authenticated_uid
     def append_upload_orig(self, uid, builddir, data):
-        orig_fname = os.path.join(builddir, self.app.pm.get_orig_fname(uid, builddir))
+        orig_fname = os.path.join(builddir, self.app.pm.get_orig_fname(builddir))
 
         # Now append to File
         fp = open(orig_fname, 'ab')
@@ -252,7 +252,7 @@ class ESoap (ServiceBase):
     @rpc(String)
     @authenticated_uid
     def del_project(self, uid, builddir):
-        self.app.pm.del_project(uid, builddir)
+        self.app.pm.del_project(builddir)
 
     @rpc(String, String, _returns=String)
     @authenticated_uid
@@ -261,19 +261,19 @@ class ESoap (ServiceBase):
             fp.write(binascii.a2b_base64(xml))
             fp.flush()
             prjid = self.app.pm.create_project(
-                uid, fp.name, url_validation=url_validation)
+                fp.name, url_validation=url_validation)
 
         return prjid
 
     @rpc(_returns=String)
     @authenticated_uid
     def new_project(self, uid):
-        return self.app.pm.new_project(uid)
+        return self.app.pm.new_project()
 
     @rpc(String, _returns=String)
     @authenticated_uid
     def get_project_busy(self, uid, builddir):
-        ret, msg = self.app.pm.project_is_busy(uid, builddir)
+        ret, msg = self.app.pm.project_is_busy(builddir)
         if not msg and not ret:
             return 'ELBE-FINISH'
         return msg
@@ -281,7 +281,7 @@ class ESoap (ServiceBase):
     @rpc(String)
     @authenticated_uid
     def rm_log(self, uid, builddir):
-        self.app.pm.rm_log(uid, builddir)
+        self.app.pm.rm_log(builddir)
 
     @rpc(String, _returns=String.customize(max_occurs='unbounded'))
     @authenticated_uid
@@ -306,4 +306,4 @@ class ESoap (ServiceBase):
     @rpc(String, String)
     @authenticated_uid
     def include_package(self, uid, builddir, filename):
-        self.app.pm.add_deb_package(uid, builddir, filename)
+        self.app.pm.add_deb_package(builddir, filename)
diff --git a/elbepack/projectmanager.py b/elbepack/projectmanager.py
index 78780e5a4c4f086acd54ad89dc8356e640c0ea04..78e00565f1379cd7a771e612bf9222bc9063f992 100644
--- a/elbepack/projectmanager.py
+++ b/elbepack/projectmanager.py
@@ -40,7 +40,7 @@ class ProjectManager:
     def stop(self):
         self.worker.stop()
 
-    def new_project(self, userid):
+    def new_project(self):
         subdir = str(uuid7())
         builddir = path.join(self.basepath, subdir)
         self.db.create_project(builddir)
@@ -48,7 +48,6 @@ class ProjectManager:
 
     def create_project(
             self,
-            userid,
             xml_file,
             url_validation=ValidationMode.CHECK_ALL):
         subdir = str(uuid7())
@@ -79,13 +78,13 @@ class ProjectManager:
             self._assert_not_busy(ep)
         return ep
 
-    def del_project(self, userid, builddir):
+    def del_project(self, builddir):
         self.db.del_project(builddir)
 
     def set_project_xml(self, builddir, xml_file):
         self.db.set_xml(builddir, xml_file)
 
-    def set_upload_cdrom(self, userid, builddir, url_validation):
+    def set_upload_cdrom(self, builddir, url_validation):
         ep = self.open_project(builddir, url_validation, allow_busy=False)
         ep.xml.set_cdrom_mirror(
             path.join(
@@ -98,7 +97,6 @@ class ProjectManager:
 
     def build_project(
             self,
-            userid,
             builddir,
             build_bin,
             build_src,
@@ -107,15 +105,15 @@ class ProjectManager:
         self.worker.enqueue(BuildJob(ep, build_bin, build_src,
                                      skip_pbuilder))
 
-    def update_pbuilder(self, userid, builddir):
+    def update_pbuilder(self, builddir):
         ep = self.open_project(builddir, allow_busy=False)
         self.worker.enqueue(UpdatePbuilderJob(ep))
 
-    def build_pbuilder(self, userid, builddir, cross, noccache, ccachesize):
+    def build_pbuilder(self, builddir, cross, noccache, ccachesize):
         ep = self.open_project(builddir, allow_busy=False)
         self.worker.enqueue(CreatePbuilderJob(ep, ccachesize, cross, noccache))
 
-    def build_pdebuild(self, userid, builddir, profile, cross):
+    def build_pdebuild(self, builddir, profile, cross):
         ep = self.open_project(builddir, allow_busy=False)
         if (not path.isdir(path.join(ep.builddir, 'pbuilder')) and
                 not path.isdir(path.join(ep.builddir, 'pbuilder_cross'))):
@@ -124,7 +122,7 @@ class ProjectManager:
 
         self.worker.enqueue(PdebuildJob(ep, profile, cross))
 
-    def set_orig_fname(self, userid, builddir, fname):
+    def set_orig_fname(self, builddir, fname):
         ep = self.open_project(builddir, allow_busy=False)
         # Write empty File
         with open(os.path.join(builddir, fname), 'w'):
@@ -138,7 +136,7 @@ class ProjectManager:
         ep.orig_fname = fname
         ep.orig_files.append(fname)
 
-    def get_orig_fname(self, userid, builddir):
+    def get_orig_fname(self, builddir):
         ep = self.open_project(builddir, allow_busy=False)
         if (not path.isdir(path.join(ep.builddir, 'pbuilder')) and
                 not path.isdir(path.join(ep.builddir, 'pbuilder_cross'))):
@@ -147,28 +145,28 @@ class ProjectManager:
 
         return ep.orig_fname
 
-    def build_chroot_tarball(self, userid, builddir):
+    def build_chroot_tarball(self, builddir):
         ep = self.open_project(builddir, allow_busy=False)
         self.worker.enqueue(BuildChrootTarJob(ep))
 
-    def build_sysroot(self, userid, builddir):
+    def build_sysroot(self, builddir):
         ep = self.open_project(builddir, allow_busy=False)
         self.worker.enqueue(BuildSysrootJob(ep))
 
-    def build_sdk(self, userid, builddir):
+    def build_sdk(self, builddir):
         ep = self.open_project(builddir, allow_busy=False)
         self.worker.enqueue(BuildSDKJob(ep))
 
-    def build_cdroms(self, userid, builddir, build_bin, build_src):
+    def build_cdroms(self, builddir, build_bin, build_src):
         ep = self.open_project(builddir, allow_busy=False)
         self.worker.enqueue(BuildCDROMsJob(ep, build_bin, build_src))
 
-    def rm_log(self, userid, builddir):
+    def rm_log(self, builddir):
         ep = self.open_project(builddir)
         with open(os.path.join(ep.builddir, 'log.txt'), 'wb', 0):
             pass
 
-    def add_deb_package(self, userid, builddir, filename):
+    def add_deb_package(self, builddir, filename):
         ep = self.open_project(builddir)
 
         t = os.path.splitext(filename)[1]  # filetype of uploaded file
@@ -186,7 +184,7 @@ class ProjectManager:
 
         ep.repo.finalize()
 
-    def project_is_busy(self, userid, builddir):
+    def project_is_busy(self, builddir):
         msg = read_loggingQ(builddir)
         return self.db.is_busy(builddir), msg
 

-- 
2.48.1



More information about the elbe-devel mailing list