Merge lp:~wgrant/launchpad/connectionstring-hates-production into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Ian Booth | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 13890 | ||||
Proposed branch: | lp:~wgrant/launchpad/connectionstring-hates-production | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
76 lines (+46/-1) 2 files modified
lib/canonical/database/postgresql.py (+6/-1) lib/canonical/database/tests/test_connectionstring.py (+40/-0) |
||||
To merge this branch: | bzr merge lp:~wgrant/launchpad/connectionstring-hates-production | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ian Booth (community) | code | Approve | |
Review via email: mp+74321@code.launchpad.net |
Commit message
ConnectionString now assumes values continue until a space character, and rejects values that seem to be quoted or escaped. Also now has better tests.
Description of the change
This branch fixes ConnectionString to not truncate production DB hostnames. See bug #843412 for details of the problem.
As I suggested in the bug, I've not implemented escaping or quoting since we don't need them in production, and they would greatly increase complexity and time to fix. I have, however, added assertions so we crash instead of misparse.
I used gina against the production configs to verify the fix:
$ LPCONFIG=gina scripts/gina.py -vv lenny # before
2011-09-07 00:30:15 DEBUG Cronscript control file not found at file:cronscript
2011-09-07 00:30:15 INFO Creating lockfile: /var/lock/
2011-09-07 00:30:21 INFO
2011-09-07 00:30:21 INFO === Processing debian/
2011-09-07 00:30:21 DEBUG Packages read from: /srv/debian-
2011-09-07 00:30:21 DEBUG Keyrings read from: /usr/share/keyrings
2011-09-07 00:30:21 INFO Components to import: main, contrib, non-free
2011-09-07 00:30:21 INFO Architectures to import: i386, powerpc, amd64
2011-09-07 00:30:21 DEBUG Launchpad database: launchpad_prod_3
2011-09-07 00:30:21 DEBUG Launchpad database host: lp
2011-09-07 00:30:21 DEBUG Launchpad database user: gina
$ LPCONFIG=gina scripts/gina.py -vv lenny # after
2011-09-07 00:29:36 DEBUG Cronscript control file not found at file:cronscript
2011-09-07 00:29:36 INFO Creating lockfile: /var/lock/
2011-09-07 00:29:41 INFO
2011-09-07 00:29:41 INFO === Processing debian/
2011-09-07 00:29:41 DEBUG Packages read from: /srv/debian-
2011-09-07 00:29:41 DEBUG Keyrings read from: /usr/share/keyrings
2011-09-07 00:29:41 INFO Components to import: main, contrib, non-free
2011-09-07 00:29:41 INFO Architectures to import: i386, powerpc, amd64
2011-09-07 00:29:41 DEBUG Launchpad database: launchpad_prod_3
2011-09-07 00:29:41 DEBUG Launchpad database host: lp-db-master.
2011-09-07 00:29:41 DEBUG Launchpad database user: gina
Looks good