[copr] skvidal-backend: thinkos/cleanups and make sure we reread the config file before starting up builders (7aa741d)

skvidal at fedoraproject.org skvidal at fedoraproject.org
Fri Nov 16 14:50:56 UTC 2012


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : skvidal-backend

>---------------------------------------------------------------

commit 7aa741d82b5268f118f6d380b3ac9a61c0c7ed5f
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Fri Nov 16 09:45:57 2012 -0500

    thinkos/cleanups and make sure we reread the config file before
    starting up builders


>---------------------------------------------------------------

 copr-be.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/copr-be.py b/copr-be.py
index 313f075..9db9f17 100644
--- a/copr-be.py
+++ b/copr-be.py
@@ -9,7 +9,7 @@ import multiprocessing
 from backend.dispatcher import Worker
 from backend import errors
 from bunch import Bunch
-from ConfigParser import ConfigParser
+import ConfigParser
 
 def _get_conf(cp, section, option, default):
     """to make returning items from config parser less irritating"""
@@ -27,14 +27,14 @@ class CoprBackend(object):
             raise errors.CoprBackendError, "Must specify config_file"
         
         self.config_file = config_file
-        self.opts = self.read_config()
+        self.opts = self.read_conf()
 
         logdir = os.path.dirname(self.opts.logfile)
         if not os.path.exists(logdir):
             os.makedirs(logdir, mode=0750)
         
         if not os.path.exists(self.opts.worker_logdir):
-            os.makedirs(self.opts.worker_logdir, module=0750)
+            os.makedirs(self.opts.worker_logdir, mode=0750)
             
         self.jobs = multiprocessing.Queue()
         self.workers = []
@@ -94,6 +94,8 @@ class CoprBackend(object):
                     self.added_jobs.append(n)
                     self.log('adding %s' % n)
 
+            # re-read config into opts
+            self.opts= self.read_conf()
             # this handles starting/growing the number of workers
             if len(self.workers) < self.opts.num_workers:
                 for i in range(self.opts.num_workers - len(self.workers)):



More information about the copr-devel mailing list