[Piuparts-commits] [piuparts] 02/02: piuparts-report.py: Use "web-host" for summary URL

Holger Levsen holger at moszumanska.debian.org
Wed Apr 30 21:31:41 UTC 2014


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

holger pushed a commit to branch develop
in repository piuparts.

commit 86d3edd46ca027a005c05cf857dbefabc0b7497e
Author: David Steele <dsteele at gmail.com>
Date:   Wed Apr 30 14:38:55 2014 -0400

    piuparts-report.py: Use "web-host" for summary URL
    
    The new summary.json code was using "master-host". For
    p.d.o, that is not valid for the web site. Create a new "web-host"
    configuration parameter, and use that for the URLs.
---
 README_server.txt  |  3 +++
 piuparts-report.py | 18 +++++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/README_server.txt b/README_server.txt
index 33af7d2..338830f 100644
--- a/README_server.txt
+++ b/README_server.txt
@@ -295,6 +295,9 @@ used for all further sections.
  effort and can be excluded from backups. By default this is
  undefined meaning that no backups of the history data will be made.
 
+* "web-host" is the domain name for the reporting web server.
+ Default: "piuparts.debian.org".
+
 * "doc-root" is the location where the webserver will serve the
  piuparts report from. Default: "/".
 
diff --git a/piuparts-report.py b/piuparts-report.py
index 4c090e6..27ea3a8 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -503,7 +503,7 @@ class Config(piupartslib.conf.Config):
                 "known-problem-directory": "@sharedir@/piuparts/known_problems",
                 "reporting-sections": "default",
                 "precedence": 1,
-                "master-host": "piuparts.debian.org",
+                "web-host": "piuparts.debian.org",
             },
             defaults_section=defaults_section)
 
@@ -563,10 +563,10 @@ def source_subdir(source):
     else:
         return source[:1]
 
-def source_summary_url(master_host, doc_root, section, src_pkg):
+def source_summary_url(web_host, doc_root, section, src_pkg):
     return( "http://%s%s/%s/source/%s/%s.html" %
               (
-                  master_host,
+                  web_host,
                   doc_root,
                   section,
                   source_subdir(src_pkg),
@@ -1464,7 +1464,7 @@ class Section:
         logging.debug("Writing stats pages for %s" % self._config.section)
         self.write_state_pages()
 
-    def generate_summary(self, master_host):
+    def generate_summary(self, web_host):
         summary_path = os.path.join(self._output_directory, "summary.json")
 
         if os.path.isfile(summary_path):
@@ -1491,7 +1491,7 @@ class Section:
                         block_cnt = self._binary_db.block_count(pkgname)
                     srcpkg = self._binary_db.get_source(pkgname)
                     url = source_summary_url(
-                              master_host, self._doc_root,
+                              web_host, self._doc_root,
                               self._config.section, srcpkg)
 
                     pkgsummary.add_summary(
@@ -1500,7 +1500,7 @@ class Section:
 
             pkgsummary.write_summary(summary, summary_path)
 
-    def generate_output(self, output_directory, section_names, problem_list, master_host):
+    def generate_output(self, output_directory, section_names, problem_list, web_host):
         # skip output generation for disabled sections
         if int(self._config["max-reserved"]) == 0:
             return
@@ -1518,7 +1518,7 @@ class Section:
         self.generate_html()
         os.chdir(oldcwd)
 
-        self.generate_summary(master_host)
+        self.generate_summary(web_host)
 
 def generate_global_summary(dir, sections):
 
@@ -1641,7 +1641,7 @@ def main():
         process_section_names = sys.argv[1:]
     master_directory = global_config["master-directory"]
     output_directory = global_config["output-directory"]
-    master_host = global_config["master-host"]
+    web_host = global_config["web-host"]
 
     doc_root = global_config["doc-root"].strip()
     if not doc_root.startswith("/"):
@@ -1657,7 +1657,7 @@ def main():
         for section_name in process_section_names:
             try:
                 section = Section(section_name, master_directory, doc_root, packagedb_cache=packagedb_cache)
-                section.generate_output(output_directory, section_names, problem_list, master_host)
+                section.generate_output(output_directory, section_names, problem_list, web_host)
             except MissingSection as e:
                 logging.error("Configuration Error in section '%s': %s" % (section_name, e))
 

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



More information about the Piuparts-commits mailing list