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
=== modified file 'config.yaml'
--- config.yaml 2015-12-30 09:05:19 +0000
+++ config.yaml 2016-01-18 16:42:07 +0000
@@ -59,7 +59,6 @@
59 default: |59 default: |
60 # Additional service specific postgresql.conf settings.60 # Additional service specific postgresql.conf settings.
61 listen_addresses='*'61 listen_addresses='*'
62 max_connections=100
63 ssl=true62 ssl=true
64 log_timezone=UTC63 log_timezone=UTC
65 log_checkpoints=true64 log_checkpoints=true
6665
=== modified file 'hooks/service.py'
--- hooks/service.py 2016-01-14 11:39:52 +0000
+++ hooks/service.py 2016-01-18 16:42:07 +0000
@@ -462,12 +462,14 @@
462 # Start with charm defaults.462 # Start with charm defaults.
463 conf.update(postgresql_conf_defaults())463 conf.update(postgresql_conf_defaults())
464464
465 # User overrides from deprecated service config.
466 conf.update(postgresql_conf_deprecated_overrides())
467
468 # User overrides from service config.465 # User overrides from service config.
469 conf.update(postgresql_conf_overrides())466 conf.update(postgresql_conf_overrides())
470467
468 # User overrides from deprecated service config. Settings are
469 # only returned if the user changed them from the default. If so,
470 # they override the settings listed in extra_pg_conf.
471 conf.update(postgresql_conf_deprecated_overrides())
472
471 # Ensure minimal settings so the charm can actually work.473 # Ensure minimal settings so the charm can actually work.
472 ensure_viable_postgresql_conf(conf)474 ensure_viable_postgresql_conf(conf)
473475
474476
=== modified file 'tests/test_integration.py'
--- tests/test_integration.py 2015-12-19 08:25:47 +0000
+++ tests/test_integration.py 2016-01-18 16:42:07 +0000
@@ -529,7 +529,15 @@
529529
530class PG93Tests(PGBaseTestCase, unittest.TestCase):530class PG93Tests(PGBaseTestCase, unittest.TestCase):
531 test_config = dict(version=(None if SERIES == 'trusty' else '9.3'),531 test_config = dict(version=(None if SERIES == 'trusty' else '9.3'),
532 pgdg=(False if SERIES == 'trusty' else True))532 pgdg=(False if SERIES == 'trusty' else True),
533 max_connections=150)
534
535 def test_deprecated_overrides(self):
536 con = self.connect()
537 cur = con.cursor()
538 cur.execute('show max_connections')
539 max_connections = cur.fetchone()[0]
540 self.assertEqual(int(max_connections), 150)
533541
534542
535class PG93MultiTests(PGMultiBaseTestCase, unittest.TestCase):543class PG93MultiTests(PGMultiBaseTestCase, unittest.TestCase):

Subscribers

People subscribed via source and target branches

to all changes: