Merge lp://qastaging/~danilo/launchpad/bug-474874 into lp://qastaging/launchpad

Proposed by Данило Шеган
Status: Merged
Approved by: Muharem Hrnjadovic
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://qastaging/~danilo/launchpad/bug-474874
Merge into: lp://qastaging/launchpad
Diff against target: 70 lines
3 files modified
database/schema/security.cfg (+4/-1)
lib/lp/translations/doc/fix_translation_credits.txt (+17/-0)
scripts/rosetta/fix_translation_credits.py (+2/-2)
To merge this branch: bzr merge lp://qastaging/~danilo/launchpad/bug-474874
Reviewer Review Type Date Requested Status
Francis J. Lacoste (community) release-critical Approve
Muharem Hrnjadovic (community) Approve
Review via email: mp+14450@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

= Bug 474874 =

Add missing privileges to rosettaadmin DB user run the one-time script fix_translation_credits. Also provide a minimal test to make sure it works with the new permissions.

= Test =

bin/test -vvt fix_translation_credits

= Demo & QA =

Try re-running it on staging as `scripts/rosetta/fix_translation_credits.py -vvv` after security.cfg changes have been applied.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  database/schema/security.cfg
  lib/lp/translations/doc/fix_translation_credits.txt
  scripts/rosetta/fix_translation_credits.py

Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

Looks good!

review: Approve
Revision history for this message
Francis J. Lacoste (flacoste) :
review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/schema/security.cfg'
2--- database/schema/security.cfg 2009-10-31 01:41:29 +0000
3+++ database/schema/security.cfg 2009-11-05 00:25:25 +0000
4@@ -1339,6 +1339,8 @@
5 public.distribution = SELECT
6 public.distroseries = SELECT
7 public.distroserieslanguage = SELECT, INSERT, UPDATE
8+public.karma = SELECT, INSERT
9+public.karmaaction = SELECT
10 public.language = SELECT
11 public.packaging = SELECT
12 public.person = SELECT
13@@ -1347,7 +1349,7 @@
14 public.pomsgid = SELECT
15 public.potemplate = SELECT, INSERT, DELETE
16 public.potmsgset = SELECT, INSERT, DELETE
17-public.potranslation = SELECT
18+public.potranslation = SELECT, INSERT
19 public.product = SELECT
20 public.productseries = SELECT
21 public.sourcepackagename = SELECT
22@@ -1356,6 +1358,7 @@
23 public.translationmessage = SELECT, INSERT, UPDATE, DELETE
24 public.translationrelicensingagreement = SELECT
25 public.translationtemplateitem = SELECT, INSERT, UPDATE, DELETE
26+public.validpersoncache = SELECT
27
28 [translationsbranchscanner]
29 type=user
30
31=== added file 'lib/lp/translations/doc/fix_translation_credits.txt'
32--- lib/lp/translations/doc/fix_translation_credits.txt 1970-01-01 00:00:00 +0000
33+++ lib/lp/translations/doc/fix_translation_credits.txt 2009-11-05 00:25:25 +0000
34@@ -0,0 +1,17 @@
35+Script `fix_translation_credits.py`
36+====================================
37+
38+Marks all existing translation credits as translated.
39+
40+ >>> from canonical.launchpad.ftests.script import run_script
41+ >>> (returncode, out, err) = run_script(
42+ ... 'scripts/rosetta/fix_translation_credits.py')
43+ >>> print returncode
44+ 0
45+ >>> print err
46+ INFO creating lockfile
47+ INFO Figuring out POFiles that need fixing: this may take a while...
48+ INFO Marking up a total of 3 credits as translated.
49+ INFO Processed ...
50+ INFO Done.
51+
52
53=== modified file 'scripts/rosetta/fix_translation_credits.py'
54--- scripts/rosetta/fix_translation_credits.py 2009-10-29 12:36:32 +0000
55+++ scripts/rosetta/fix_translation_credits.py 2009-11-05 00:25:25 +0000
56@@ -9,12 +9,12 @@
57
58 import _pythonpath
59
60-from lp.services.scripts.base import LaunchpadCronScript
61+from lp.services.scripts.base import LaunchpadScript
62 from lp.translations.scripts.fix_translation_credits import (
63 FixTranslationCreditsProcess)
64
65
66-class FixTranslationCredits(LaunchpadCronScript):
67+class FixTranslationCredits(LaunchpadScript):
68 """Go through all POFiles and mark translation credits as translated."""
69
70 def main(self):