← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stub/launchpad/db-cleanups into lp:launchpad/db-devel

 

Stuart Bishop has proposed merging lp:~stub/launchpad/db-cleanups into lp:launchpad/db-devel with lp:~stub/launchpad/pending-db-changes as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #813761 in Launchpad itself: "Warnings from nondowntime-security-update.sh"
  https://bugs.launchpad.net/launchpad/+bug/813761

For more details, see:
https://code.launchpad.net/~stub/launchpad/db-cleanups/+merge/69038

= Summary =

Scripts should all connect as unique database users.

== Proposed fix ==

Fix this.

== Pre-implementation notes ==

== Implementation details ==

This branch fixes three cronscripts connecting as the archivepublisher dbuser.

== Tests ==

== Demo and Q/A ==


= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  database/schema/security.cfg
  cronscripts/publish-ftpmaster.py
  cronscripts/generate-ppa-htaccess.py
  cronscripts/generate-contents-files.py

./cronscripts/publish-ftpmaster.py
       8: '_pythonpath' imported but unused
./cronscripts/generate-ppa-htaccess.py
      10: '_pythonpath' imported but unused
./cronscripts/generate-contents-files.py
       8: '_pythonpath' imported but unused
-- 
https://code.launchpad.net/~stub/launchpad/db-cleanups/+merge/69038
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stub/launchpad/db-cleanups into lp:launchpad/db-devel.
=== modified file 'cronscripts/generate-contents-files.py'
--- cronscripts/generate-contents-files.py	2011-07-11 13:33:13 +0000
+++ cronscripts/generate-contents-files.py	2011-07-25 08:29:37 +0000
@@ -7,7 +7,6 @@
 
 import _pythonpath
 
-from canonical.config import config
 from lp.archivepublisher.scripts.generate_contents_files import (
     GenerateContentsFiles,
     )
@@ -15,5 +14,5 @@
 
 if __name__ == '__main__':
     script = GenerateContentsFiles(
-        "generate-contents", dbuser=config.archivepublisher.dbuser)
+        "generate-contents", dbuser='generate_contents_files')
     script.lock_and_run()

=== modified file 'cronscripts/generate-ppa-htaccess.py'
--- cronscripts/generate-ppa-htaccess.py	2010-04-27 19:48:39 +0000
+++ cronscripts/generate-ppa-htaccess.py	2011-07-25 08:29:37 +0000
@@ -9,13 +9,12 @@
 
 import _pythonpath
 
-from canonical.config import config
 from lp.archivepublisher.scripts.generate_ppa_htaccess import (
     HtaccessTokenGenerator)
 
 
 if __name__ == '__main__':
     script = HtaccessTokenGenerator(
-        'generate-ppa-htaccess', dbuser=config.generateppahtaccess.dbuser)
+        'generate-ppa-htaccess', dbuser='generate_ppa_htaccess')
     script.lock_and_run()
 

=== modified file 'cronscripts/publish-ftpmaster.py'
--- cronscripts/publish-ftpmaster.py	2011-03-31 06:29:09 +0000
+++ cronscripts/publish-ftpmaster.py	2011-07-25 08:29:37 +0000
@@ -13,5 +13,5 @@
 
 if __name__ == '__main__':
     script = PublishFTPMaster(
-        "publish-ftpmaster", dbuser=config.archivepublisher.dbuser)
+        "publish-ftpmaster", 'publish_ftpmaster')
     script.lock_and_run()

=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg	2011-07-23 07:59:41 +0000
+++ database/schema/security.cfg	2011-07-25 08:29:37 +0000
@@ -2274,3 +2274,16 @@
 public.potemplate                       = SELECT
 public.sourcepackagename                = SELECT
 type=user
+
+[generate_contents_files]
+type=user
+groups=archivepublisher
+
+[publish_ftpmaster]
+type=user
+groups=archivepublisher
+
+[generate_ppa_htaccess]
+type=user
+groups=archivepublisher
+