Merge lp:~stub/charms/trusty/postgresql/fix-max-connections into lp:charms/trusty/postgresql

Proposed by Stuart Bishop
Status: Merged
Merged at revision: 142
Proposed branch: lp:~stub/charms/trusty/postgresql/fix-max-connections
Merge into: lp:charms/trusty/postgresql
Diff against target: 54 lines (+14/-5)
3 files modified
config.yaml (+0/-1)
hooks/service.py (+5/-3)
tests/test_integration.py (+9/-1)
To merge this branch: bzr merge lp:~stub/charms/trusty/postgresql/fix-max-connections
Reviewer Review Type Date Requested Status
Review Queue (community) automated testing Needs Fixing
Andrew McLeod (community) Approve
charmers Pending
Review via email: mp+282974@code.launchpad.net

Description of the change

Some deprecated options where not overriding the defaults in extra_pg_conf. Fix this by collating the settings in the correct order (overrides second).

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

The config.yaml change is removing a duplicate entry in the extra_pg_conf default.

Revision history for this message
Andrew McLeod (admcleod) wrote :

bundletested this, all tests passed, looks good. The automated tests seem to be stuck... +1

review: Approve
Revision history for this message
Review Queue (review-queue) wrote :

The results (PASS) are in and available here: http://juju-ci.vapour.ws:8080/job/charm-bundle-test-aws/2254/

review: Approve (automated testing)
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/2446/

review: Needs Fixing (automated testing)
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/2447/

review: Needs Fixing (automated testing)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2015-12-30 09:05:19 +0000
3+++ config.yaml 2016-01-18 16:42:07 +0000
4@@ -59,7 +59,6 @@
5 default: |
6 # Additional service specific postgresql.conf settings.
7 listen_addresses='*'
8- max_connections=100
9 ssl=true
10 log_timezone=UTC
11 log_checkpoints=true
12
13=== modified file 'hooks/service.py'
14--- hooks/service.py 2016-01-14 11:39:52 +0000
15+++ hooks/service.py 2016-01-18 16:42:07 +0000
16@@ -462,12 +462,14 @@
17 # Start with charm defaults.
18 conf.update(postgresql_conf_defaults())
19
20- # User overrides from deprecated service config.
21- conf.update(postgresql_conf_deprecated_overrides())
22-
23 # User overrides from service config.
24 conf.update(postgresql_conf_overrides())
25
26+ # User overrides from deprecated service config. Settings are
27+ # only returned if the user changed them from the default. If so,
28+ # they override the settings listed in extra_pg_conf.
29+ conf.update(postgresql_conf_deprecated_overrides())
30+
31 # Ensure minimal settings so the charm can actually work.
32 ensure_viable_postgresql_conf(conf)
33
34
35=== modified file 'tests/test_integration.py'
36--- tests/test_integration.py 2015-12-19 08:25:47 +0000
37+++ tests/test_integration.py 2016-01-18 16:42:07 +0000
38@@ -529,7 +529,15 @@
39
40 class PG93Tests(PGBaseTestCase, unittest.TestCase):
41 test_config = dict(version=(None if SERIES == 'trusty' else '9.3'),
42- pgdg=(False if SERIES == 'trusty' else True))
43+ pgdg=(False if SERIES == 'trusty' else True),
44+ max_connections=150)
45+
46+ def test_deprecated_overrides(self):
47+ con = self.connect()
48+ cur = con.cursor()
49+ cur.execute('show max_connections')
50+ max_connections = cur.fetchone()[0]
51+ self.assertEqual(int(max_connections), 150)
52
53
54 class PG93MultiTests(PGMultiBaseTestCase, unittest.TestCase):

Subscribers

People subscribed via source and target branches

to all changes: