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

Proposed by Stuart Bishop on 2011-07-25
Status: Merged
Approved by: Stuart Bishop on 2011-07-25
Approved revision: no longer in the source branch.
Merged at revision: 10815
Proposed branch: lp:~stub/launchpad/db-cleanups
Merge into: lp:launchpad/db-devel
Prerequisite: lp:~stub/launchpad/pending-db-changes
Diff against target: 51 lines (+10/-4)
3 files modified
cronscripts/generate-contents-files.py (+1/-2)
cronscripts/publish-ftpmaster.py (+1/-2)
database/schema/security.cfg (+8/-0)
To merge this branch: bzr merge lp:~stub/launchpad/db-cleanups
Reviewer Review Type Date Requested Status
Robert Collins (community) 2011-07-25 Approve on 2011-07-25
Review via email: mp+69038@code.launchpad.net

Commit message

[r=lifeless][bug=815753] Fix publish-ftpmaster and generate-contents-files to connect as unique database users.

Description of the change

= 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

To post a comment you must log in.
Robert Collins (lifeless) wrote :

Looks fine to me, though perhaps we want some guidelines somewhere about when to hard code and when to use the config (for dbuser).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cronscripts/generate-contents-files.py'
2--- cronscripts/generate-contents-files.py 2011-07-11 13:33:13 +0000
3+++ cronscripts/generate-contents-files.py 2011-07-25 08:53:30 +0000
4@@ -7,7 +7,6 @@
5
6 import _pythonpath
7
8-from canonical.config import config
9 from lp.archivepublisher.scripts.generate_contents_files import (
10 GenerateContentsFiles,
11 )
12@@ -15,5 +14,5 @@
13
14 if __name__ == '__main__':
15 script = GenerateContentsFiles(
16- "generate-contents", dbuser=config.archivepublisher.dbuser)
17+ "generate-contents", dbuser='generate_contents_files')
18 script.lock_and_run()
19
20=== modified file 'cronscripts/publish-ftpmaster.py'
21--- cronscripts/publish-ftpmaster.py 2011-03-31 06:29:09 +0000
22+++ cronscripts/publish-ftpmaster.py 2011-07-25 08:53:30 +0000
23@@ -7,11 +7,10 @@
24
25 import _pythonpath
26
27-from canonical.config import config
28 from lp.archivepublisher.scripts.publish_ftpmaster import PublishFTPMaster
29
30
31 if __name__ == '__main__':
32 script = PublishFTPMaster(
33- "publish-ftpmaster", dbuser=config.archivepublisher.dbuser)
34+ "publish-ftpmaster", 'publish_ftpmaster')
35 script.lock_and_run()
36
37=== modified file 'database/schema/security.cfg'
38--- database/schema/security.cfg 2011-07-23 07:59:41 +0000
39+++ database/schema/security.cfg 2011-07-25 08:53:30 +0000
40@@ -2274,3 +2274,11 @@
41 public.potemplate = SELECT
42 public.sourcepackagename = SELECT
43 type=user
44+
45+[generate_contents_files]
46+type=user
47+groups=archivepublisher
48+
49+[publish_ftpmaster]
50+type=user
51+groups=archivepublisher

Subscribers

People subscribed via source and target branches

to status/vote changes: