[Pkg-debile-commits] [debile-master] 01/01: Code simplification, remove dependency cycle

Léo Cavaillé leo.cavaille-guest at alioth.debian.org
Fri Aug 23 15:05:33 UTC 2013


This is an automated email from the git hooks/post-receive script.

leo.cavaille-guest pushed a commit to branch master
in repository debile-master.

commit 4a676b3252040086c0572784e68a242e2a90678e
Author: Léo Cavaillé <leo at cavaille.net>
Date:   Fri Aug 23 17:05:09 2013 +0200

    Code simplification, remove dependency cycle
---
 debile/master/archive.py |   24 ------------------------
 debile/master/server.py  |   21 ++++++++++++++++++++-
 2 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/debile/master/archive.py b/debile/master/archive.py
index 40f5683..81741c2 100644
--- a/debile/master/archive.py
+++ b/debile/master/archive.py
@@ -1,7 +1,6 @@
 from debile.master.config import Config
 from debile.master.orm import User, Source, Binary, Package
 from debile.master.utils import run_command
-import debile.master.server
 from debian import deb822
 import shutil
 import os
@@ -26,29 +25,6 @@ def check_user_repository_consitency():
     return
 
 
-def generate_builders_dputcf():
-    session = debile.master.server.Session()
-    config = Config()
-    users = session.query(User.login).all()
-
-    dputcf = ""
-    for u in users:
-        build_flavors = listize(config.get('jobs', 'build-flavors'))
-        for compiler in build_flavors:
-            # TODO : convertible to a template
-            l = "[%s-%s]\n" % (u.login, compiler)
-            l += "fqdn = %s\n" % config.get('paths', 'debile_fqdn')
-            l += "incoming = %s\n" % os.path.join(
-                                    config.get('paths', 'incoming_path'),
-                                    u.login,
-                                    compiler)
-            l += "method = scp\n"
-            l += "login = debile\n"
-            dputcf += l
-            dputcf += "\n"
-    return dputcf
-
-
 class UserRepository:
     """
     We call a UserRepository the set incoming + pool
diff --git a/debile/master/server.py b/debile/master/server.py
index 8fd3ea8..4d90e2b 100644
--- a/debile/master/server.py
+++ b/debile/master/server.py
@@ -269,7 +269,26 @@ class DebileMasterInterface(object):
 
     @machine_method
     def get_dputcf(self):
-        return generate_builders_dputcf()
+        config = Config()
+        session = Session()
+        users = session.query(User.login).all()
+
+        dputcf = ""
+        for u in users:
+            build_flavors = listize(config.get('jobs', 'build-flavors'))
+            for compiler in build_flavors:
+                # TODO : convertible to a template
+                l = "[%s-%s]\n" % (u.login, compiler)
+                l += "fqdn = %s\n" % config.get('paths', 'debile_fqdn')
+                l += "incoming = %s\n" % os.path.join(
+                                        config.get('paths', 'incoming_path'),
+                                        u.login,
+                                        compiler)
+                l += "method = scp\n"
+                l += "login = debile\n"
+                dputcf += l
+                dputcf += "\n"
+        return dputcf
 
     @machine_method
     def get_current_jobs(self):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-master.git



More information about the Pkg-debile-commits mailing list