Merge lp:~nottrobin/charms/trusty/apache2/relation-servername into lp:charms/trusty/apache2

Proposed by Robin Winslow
Status: Merged
Merged at revision: 60
Proposed branch: lp:~nottrobin/charms/trusty/apache2/relation-servername
Merge into: lp:charms/trusty/apache2
Diff against target: 18 lines (+6/-2)
1 file modified
hooks/hooks.py (+6/-2)
To merge this branch: bzr merge lp:~nottrobin/charms/trusty/apache2/relation-servername
Reviewer Review Type Date Requested Status
Marco Ceppi (community) Approve
Review Queue (community) automated testing Needs Fixing
Review via email: mp+249071@code.launchpad.net

Description of the change

For the assets manager project mojo spec (lp:~canonical-is/canonical-mojo-specs/mojo-comms-assets) we need access to the `servername` setting when the `website` relation is created.

I thought this would be a generally useful feature, and certainly wouldn't do any harm as it can just be ignored by charsm that don't want to use it, so I thought it'd be better to submit this MP rather than create a permanent fork of the apache2 charm.

To post a comment you must log in.
Revision history for this message
Review Queue (review-queue) wrote :

This items has failed automated testing! Results available here http://reports.vapour.ws/charm-tests/charm-bundle-test-11009-results

review: Needs Fixing (automated testing)
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

I'm 110% cautious allowing optional parameters to interfaces, but we spoke about this in chat already. Letting this one through.

review: Approve

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 2014-12-29 19:26:41 +0000
3+++ hooks/hooks.py 2015-02-09 13:18:17 +0000
4@@ -771,8 +771,12 @@
5 if my_host == "localhost":
6 my_host = socket.gethostname()
7 default_port = 80
8- subprocess.call(['relation-set', 'port=%d' % default_port,
9- 'hostname=%s' % my_host])
10+ subprocess.call([
11+ 'relation-set',
12+ 'port=%d' % default_port,
13+ 'hostname=%s' % my_host,
14+ 'servername=%s' % config_get('servername')
15+ ])
16
17
18 def ensure_ports(ports):

Subscribers

People subscribed via source and target branches

to all changes: