Merge lp:~thomir-deactivatedaccount/charms/trusty/postgresql/fix-for-lxc into lp:charms/trusty/postgresql

Proposed by Thomi Richards
Status: Rejected
Rejected by: Stuart Bishop
Proposed branch: lp:~thomir-deactivatedaccount/charms/trusty/postgresql/fix-for-lxc
Merge into: lp:charms/trusty/postgresql
Diff against target: 20 lines (+9/-1)
1 file modified
hooks/hooks.py (+9/-1)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/charms/trusty/postgresql/fix-for-lxc
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Disapprove
Review via email: mp+271215@code.launchpad.net

Commit message

Make the postgres charm installable on lxc / juju local provider.

Description of the change

Make the postgres charm installable on lxc / juju local provider.

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

I need to leave this until the rewrite branch lands, which has unfortunately been waiting for review for a couple of weeks. I suspect it won't be needed, as the rewrite using charmhelpers.core.sysctl and error handling can be done there.

lp:~stub/charms/trusty/postgresql/rewrite if you want to test the rework.

review: Disapprove

Unmerged revisions

130. By Thomi Richards

Make postgres charm work for lxc provider.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2015-08-07 16:14:56 +0000
3+++ hooks/hooks.py 2015-09-16 00:54:02 +0000
4@@ -387,7 +387,15 @@
5 def _run_sysctl(postgresql_sysctl):
6 """sysctl -p postgresql_sysctl, helper for easy test mocking."""
7 # Do not error out when this fails. It is not likely to work under LXC.
8- return run("sysctl -p {}".format(postgresql_sysctl), exit_on_error=False)
9+ # exit_on_error only controls whether sys.exit is called. An exception
10+ # will be raised in all cases.
11+ try:
12+ return run(
13+ "sysctl -p {}".format(postgresql_sysctl),
14+ exit_on_error=False
15+ )
16+ except subprocess.CalledProcessError:
17+ return ""
18
19
20 def create_postgresql_config(config_file):

Subscribers

People subscribed via source and target branches

to all changes: