Merge lp:~dpb/charms/precise/apache2/reverseproxy-move into lp:charms/apache2

Proposed by David Britton
Status: Merged
Approved by: Mark Mims
Approved revision: 41
Merged at revision: 38
Proposed branch: lp:~dpb/charms/precise/apache2/reverseproxy-move
Merge into: lp:charms/apache2
Diff against target: 37 lines (+4/-3)
3 files modified
hooks/hooks.py (+1/-0)
metadata.yaml (+2/-2)
revision (+1/-1)
To merge this branch: bzr merge lp:~dpb/charms/precise/apache2/reverseproxy-move
Reviewer Review Type Date Requested Status
Mark Mims (community) Approve
charmers Pending
Review via email: mp+148056@code.launchpad.net

Description of the change

- move reverseproxy to a "requires" relation. This matches what haproxy would expect allowing you to have something like this:

  apache2:reverseproxy <=> haproxy:website ... haproxy:reverseproxy <=> application:website

I realize that the provides and requires thing is largely convention, but this one seems like it's in the wrong place, especially when viewed through the light of haproxy (which the README.md already mentions).

- small fix to sanitize service names (strip out non-python-variable-characters from service names) as was done for the unit names. Jinja2 requires this, and the README.md had already been updated to reflect this.

To post a comment you must log in.
Revision history for this message
Mark Mims (mark-mims) wrote :

apache2 still needs to provide an http interface (perhaps "website") so that it can sit _behind_ a reverse-proxy

review: Needs Fixing
Revision history for this message
David Britton (dpb) wrote :

There is a "website" relation in hooks.py. I see in revision 21 it was removed from the metadata file and the hook symlinks were deleted:

  "Also removed website relation as it isn't used to make charm proof happy."

As the code was still in hooks.py, and it doesn't appear wrong, I put those back in.

Revision history for this message
Mark Mims (mark-mims) wrote :

one fix I'll add on top, but otherwise lgtm

Revision history for this message
Mark Mims (mark-mims) :
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 2013-02-08 21:59:00 +0000
3+++ hooks/hooks.py 2013-02-12 22:33:19 +0000
4@@ -297,6 +297,7 @@
5 service_name = service_item['service_name']
6 service_port = service_item['service_port']
7 service_key = '%s_%s' % (unit_type, service_name)
8+ service_key = re.sub('[^a-zA-Z0-9_]*', '', service_key)
9 reverseproxy_data[service_key] = '%s:%s' % (host, service_port)
10 relation_data.update(reverseproxy_data)
11 return relation_data
12
13=== modified file 'metadata.yaml'
14--- metadata.yaml 2013-01-29 17:31:09 +0000
15+++ metadata.yaml 2013-02-12 22:33:19 +0000
16@@ -9,12 +9,12 @@
17 IPv6, easy scripting and database integration, request/response
18 filtering, many flexible authentication schemes, and more.
19 provides:
20- reverseproxy:
21- interface: http
22 nrpe-external-master:
23 interface: nrpe-external-master
24 scope: container
25 requires:
26+ reverseproxy:
27+ interface: http
28 website-cache:
29 interface: http
30 balancer:
31
32=== modified file 'revision'
33--- revision 2013-02-01 23:05:11 +0000
34+++ revision 2013-02-12 22:33:19 +0000
35@@ -1,1 +1,1 @@
36-2
37+4

Subscribers

People subscribed via source and target branches

to all changes: