[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.47-22-g77d3c57

Andreas Beckmann debian at abeckmann.de
Sun Nov 4 14:13:21 UTC 2012


The following commit has been merged in the develop branch:
commit 8852e5842c31b35d668088286dde9ca166a3f374
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Sat Nov 3 16:07:47 2012 +0100

    p-m: set default log-file to $SECTION/master.log
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/README.txt b/README.txt
index 9e21071..ce78fb2 100644
--- a/README.txt
+++ b/README.txt
@@ -462,7 +462,7 @@ section, too, and will serve as defaults for all other sections
 
 * "min-tgz-retry-delay" is used to specify the minimum time (in seconds) between attempts to recreate a tarball which was created more than "max-tgz-age" seconds ago. The default is 21600 seconds, which is 6h.
 
-* "log-file" is the name of a file to where the master should write its log messages. In the default configuration file it is "/dev/null", that is, log messages are not put in a file.
+* "log-file" is the name of a file to where the master should write its log messages. In the default configuration file it is "$SECTION/master.log". To disable logging, set it to "/dev/null".
 
 * "piuparts-cmd" is the command the slave uses to start piuparts. It should include 'sudo' if necessary so that piuparts runs with sufficient priviledges to do its testing (and that means root priviledges).
 
diff --git a/conf/piuparts.conf.sample b/conf/piuparts.conf.sample
index 2784205..c838d7d 100644
--- a/conf/piuparts.conf.sample
+++ b/conf/piuparts.conf.sample
@@ -39,7 +39,6 @@ upgrade-test-distros =
 upgrade-test-chroot-tgz =
 max-reserved = 50
 debug = no
-log-file = sid-master.log
 
 
 ## another example:
diff --git a/debian/changelog b/debian/changelog
index 145db6d..40cbbd5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,8 @@ piuparts (0.48) UNRELEASED; urgency=low
     - Add --install-recommends option, disabled by default.
   * piuparts-master.py:
     - Enable recycling before initializing the real package db.
+    - Enable logging by default and set default log-file to
+      $SECTION/master.log. Use "/dev/null" to disable logging.
   * piuparts-slave.py:
   * piuparts-report.py:
   * detect_piuparts_issues: Catch the chroot running out of space.
diff --git a/piuparts-master.py b/piuparts-master.py
index e680c2e..a3633c9 100644
--- a/piuparts-master.py
+++ b/piuparts-master.py
@@ -294,13 +294,14 @@ def main():
         config = Config(section=section, defaults_section="global")
         config.read(CONFIG_FILE)
 
-        setup_logging(logging.DEBUG, config["log-file"])
-
         if not os.path.exists(os.path.join(master_directory, section)):
             os.makedirs(os.path.join(master_directory, section))
 
         os.chdir(master_directory)
 
+        logfile = config["log-file"] or os.path.join(section, "master.log")
+        setup_logging(logging.DEBUG, logfile)
+
         lock = open(os.path.join(section, "master.lock"), "we")
         try:
             fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)

-- 
piuparts git repository



More information about the Piuparts-commits mailing list