[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.44-755-ga3ab31d
Andreas Beckmann
debian at abeckmann.de
Mon Jun 18 11:38:14 UTC 2012
The following commit has been merged in the piatti branch:
commit fae5f52d9beb95019bb4fc5bd6284fe9ff8ef256
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Thu Jun 14 19:09:29 2012 +0200
p-m/s/r: load defaults for [section] from [global]
Use defaults_section="global" when loading a Section config.
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/README.txt b/README.txt
index 32b599d..cfc2ff7 100644
--- a/README.txt
+++ b/README.txt
@@ -410,6 +410,13 @@ used for all further sections.
* "sections" defaults to sid and defines which sections should be processed in master-slave mode. Each section defined here has to have a section with the section specific settings explained below. The first section defined should always be sid, because the data from first section a package is in is used for the source package html report.
+==== section specific configuration
+
+The section specific settings will be reloaded each time a section
+is being run. All these keys can be specified in the [global]
+section, too, and will serve as defaults for all other sections
+(overriding the builtin defaults).
+
* "master-host" is the host where the master exists. The slave will give this host to ssh. This option is mandatory.
* "master-user" is the username of the master. The slave will log in using this username. This option is mandatory.
@@ -424,11 +431,6 @@ used for all further 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.
-==== section specific configuration
-
-The section specific settings will be reloaded each time a section
-is being run.
-
* "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.
* "packages-url" is a URL to the Packages.bz2 file specifying what packages should be tested. This needs to be a Packages.bz2 file, other compression methods are not supported. For example, you might use 'http://ftp.debian.org/debian/dists/sid/main/binary-i386/Packages.bz2' but you really do want to replace "ftp.debian.org" with the name of your local mirror.
diff --git a/debian/changelog b/debian/changelog
index 4a6fda0..233f8a3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -73,6 +73,7 @@ piuparts (0.45) UNRELEASED; urgency=low
- Remove metapackage build directory on error exit. (Closes: #663702)
- Don't remove eatmydata when minimizing a chroot. (Closes: #658962)
* piuparts.conf:
+ - Defaults for all [section] settings can be set in the [global] section.
- Make master-command a [global] instead of a [section] setting.
The section name will be given as an argument to this command.
- Removed deprecated keys: known_circular_depends.
diff --git a/piuparts-master.py b/piuparts-master.py
index e5b6150..b58a809 100644
--- a/piuparts-master.py
+++ b/piuparts-master.py
@@ -48,13 +48,14 @@ def setup_logging(log_level, log_file_name):
class Config(piupartslib.conf.Config):
- def __init__(self, section="master"):
+ def __init__(self, section="master", defaults_section=None):
piupartslib.conf.Config.__init__(self, section,
{
"log-file": None,
"packages-url": None,
"master-directory": ".",
- })
+ },
+ defaults_section=defaults_section)
class CommandSyntaxError(Exception):
@@ -199,7 +200,7 @@ def main():
master_directory = global_config["master-directory"]
section = sys.argv[1]
- config = Config(section=section)
+ config = Config(section=section, defaults_section="global")
config.read(CONFIG_FILE)
setup_logging(logging.DEBUG, config["log-file"])
diff --git a/piuparts-report.py b/piuparts-report.py
index b91424d..7ff0d8a 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -413,7 +413,7 @@ linktarget_by_template = [
class Config(piupartslib.conf.Config):
- def __init__(self, section="report"):
+ def __init__(self, section="report", defaults_section=None):
self.section = section
piupartslib.conf.Config.__init__(self, section,
{
@@ -425,7 +425,8 @@ class Config(piupartslib.conf.Config):
"description": "",
"max-reserved": 1,
"doc-root": "/piuparts/",
- })
+ },
+ defaults_section=defaults_section)
def setup_logging(log_level, log_file_name):
@@ -586,7 +587,7 @@ def get_email_address(maintainer):
class Section:
def __init__(self, section, master_directory, doc_root):
- self._config = Config(section=section)
+ self._config = Config(section=section, defaults_section="global")
self._config.read(CONFIG_FILE)
logging.debug("-------------------------------------------")
logging.debug("Running section " + self._config.section)
diff --git a/piuparts-slave.py b/piuparts-slave.py
index 5c70363..f86d455 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -59,7 +59,7 @@ def setup_logging(log_level, log_file_name):
class Config(piupartslib.conf.Config):
- def __init__(self, section="slave"):
+ def __init__(self, section="slave", defaults_section=None):
self.section = section
piupartslib.conf.Config.__init__(self, section,
{
@@ -84,7 +84,8 @@ class Config(piupartslib.conf.Config):
"keep-sources-list": "no",
"arch": None,
"precedence": "1",
- })
+ },
+ defaults_section=defaults_section)
class Alarm(Exception):
@@ -247,7 +248,7 @@ class Section:
def __init__(self, section, global_config):
self._global_config = global_config
- self._config = Config(section=section)
+ self._config = Config(section=section, defaults_section="global")
self._config.read(CONFIG_FILE)
self._sleep_until = 0
self._slave_directory = os.path.abspath(self._config["slave-directory"])
@@ -304,7 +305,7 @@ class Section:
logging.info("-------------------------------------------")
logging.info("Running section %s (precedence=%d)" % (self._config.section, self.precedence()))
- self._config = Config(section=self._config.section)
+ self._config = Config(section=self._config.section, defaults_section="global")
self._config.read(CONFIG_FILE)
if int(self._config["max-reserved"]) == 0:
--
piuparts git repository
More information about the Piuparts-commits
mailing list