[elbe-devel] [PATCH 4/8] elbepack: db: remove list_users()

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


The usermanagement of elbe is being removed.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 bash-completion                | 2 +-
 docs/elbe-control.rst          | 4 ----
 docs/elbe-db.rst               | 4 ----
 elbepack/commands/control.py   | 8 --------
 elbepack/commands/db.py        | 9 ---------
 elbepack/daemons/soap/esoap.py | 6 ------
 elbepack/db.py                 | 8 --------
 7 files changed, 1 insertion(+), 40 deletions(-)

diff --git a/bash-completion b/bash-completion
index 1f22944962bd..3b44a93cb1dd 100644
--- a/bash-completion
+++ b/bash-completion
@@ -106,7 +106,7 @@ _cmd_args_completion_elbe()
             control)
                 file_arg=true
                 disable_space=true
-                cmd_opt=$(_elbe_subcmd_with_opt 'rm_log list_projects list_users create_project reset_project \
+                cmd_opt=$(_elbe_subcmd_with_opt 'rm_log list_projects create_project reset_project \
                                                  del_project set_xml build build_sysroot build_sdk build_cdroms get_file \
                                                  build_chroot_tarball dump_file get_files wait_busy set_cdrom set_orig \
 						 set_pdebuild build_pbuilder update_pbuilder')
diff --git a/docs/elbe-control.rst b/docs/elbe-control.rst
index 32a672243456..36a8e75eb558 100644
--- a/docs/elbe-control.rst
+++ b/docs/elbe-control.rst
@@ -23,7 +23,6 @@ SYNOPSIS
       elbe control [options] set_orig <build-dir>
       elbe control [options] set_cdrom <build-dir> <iso-img>
       elbe control [options] reset_project <build-dir>
-      elbe control [options] list_users
       elbe control [options] wait_busy <build-dir>
       elbe control [options] set_xml <build-dir> <xmlfile>
       elbe control [options] del_project <build-dir>
@@ -151,9 +150,6 @@ a ./debian folder with a valid debianization.
 
    Use with care.
 
-*list_users*
-   List configured users. Only admins may use this command.
-
 *wait_busy* <build-dir>
    Wait, while <build-dir> is busy.
 
diff --git a/docs/elbe-db.rst b/docs/elbe-db.rst
index bb995995f254..954ceedc0bff 100644
--- a/docs/elbe-db.rst
+++ b/docs/elbe-db.rst
@@ -16,7 +16,6 @@ SYNOPSIS
       elbe db [options] create_project <project_dir>
       elbe db [options] get_files <project_dir>
       elbe db [options] reset_project <project_dir>
-      elbe db [options] list_users
       elbe db [options] save_version <project_dir>
       elbe db [options] set_xml <project_dir> <xml_file>
       elbe db [options] del_project <project_dir>
@@ -59,9 +58,6 @@ COMMANDS
 *list_projects*
    Lists all projects stored in the database.
 
-*list_users*
-   Lists all users registered in the ELBE database.
-
 *create_project* <project_dir>
    Creates a new project in directory <project_dir>. Options: user.
 
diff --git a/elbepack/commands/control.py b/elbepack/commands/control.py
index a502cdcaba0d..6b0ae7cbb50f 100644
--- a/elbepack/commands/control.py
+++ b/elbepack/commands/control.py
@@ -38,13 +38,6 @@ def _list_projects(client, args):
         print('No projects configured in initvm')
 
 
-def _list_users(client, args):
-    users = client.service.list_users()
-
-    for u in users.string:
-        print(u)
-
-
 def _create_project(client, args):
     uuid = client.service.new_project()
     print(uuid)
@@ -201,7 +194,6 @@ def _update_pbuilder(client, args):
 _client_actions = {
     'rm_log':               _remove_log,
     'list_projects':        _list_projects,
-    'list_users':           _list_users,
     'create_project':       _create_project,
     'reset_project':        _reset_project,
     'del_project':          _delete_project,
diff --git a/elbepack/commands/db.py b/elbepack/commands/db.py
index 374b7346aff6..43d32be0cf21 100644
--- a/elbepack/commands/db.py
+++ b/elbepack/commands/db.py
@@ -28,14 +28,6 @@ def _list_projects(args):
         print(f'{p.builddir}: {p.name} [{p.version}] {p.edit}')
 
 
-def _list_users(args):
-    db = ElbeDB()
-    users = db.list_users()
-
-    for u in users:
-        print(f'{u.name}: {u.fullname} <{u.email}>')
-
-
 @add_argument('--user', dest='user',
               help='user name of the designated project owner')
 @add_argument('project_dir')
@@ -138,7 +130,6 @@ def _print_version_xml(args):
 _actions = {
     'init':                _init,
     'list_projects':       _list_projects,
-    'list_users':          _list_users,
     'create_project':      _create_project,
     'del_project':         _del_project,
     'set_xml':             _set_xml,
diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index 2c9f73717a12..d71bd4171f76 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -43,12 +43,6 @@ class ESoap (ServiceBase):
         s.save()
         return True
 
-    @rpc(_returns=Array(String))
-    @soap_faults
-    @authenticated_admin
-    def list_users(self):
-        return [u.name for u in self.app.pm.db.list_users()]
-
     @rpc(_returns=Array(SoapProject))
     @soap_faults
     @authenticated_admin
diff --git a/elbepack/db.py b/elbepack/db.py
index 540a5bb07fe6..860565bbfb83 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -119,14 +119,6 @@ class ElbeDB:
         smaker = sessionmaker(bind=engine)
         self.session = scoped_session(smaker)
 
-    def list_users(self):
-        with session_scope(self.session) as s:
-            res = s.query(User).all()
-            ret = []
-            for u in res:
-                ret.append(UserData(u))
-            return ret
-
     def list_projects(self):
         with session_scope(self.session) as s:
             res = s.query(Project).all()

-- 
2.46.0



More information about the elbe-devel mailing list