Merge lp:~aisrael/charm-helpers/HttpRelation into lp:charm-helpers

Proposed by Adam Israel
Status: Needs review
Proposed branch: lp:~aisrael/charm-helpers/HttpRelation
Merge into: lp:charm-helpers
Diff against target: 17 lines (+3/-3)
1 file modified
charmhelpers/core/services/helpers.py (+3/-3)
To merge this branch: bzr merge lp:~aisrael/charm-helpers/HttpRelation
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+247491@code.launchpad.net

Description of the change

This MP makes to changes to the HttpRelation:

1: change the 'host' required_key to 'hostname'. I did a cursory check of all charms returned via 'charm getall' and all of the website relations are using hostname.

2: change provide_data to return the hostname and port keys from the data provided by the relation, rather than private-address and the hard-coded port 80.

To post a comment you must log in.

Unmerged revisions

294. By Adam Israel

Change the host required_key to hostname
Change provide_data to return the port provided by the relation, instead of assuming port 80

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/core/services/helpers.py'
2--- charmhelpers/core/services/helpers.py 2015-01-22 06:06:03 +0000
3+++ charmhelpers/core/services/helpers.py 2015-01-23 22:10:36 +0000
4@@ -146,12 +146,12 @@
5 """
6 name = 'website'
7 interface = 'http'
8- required_keys = ['host', 'port']
9+ required_keys = ['hostname', 'port']
10
11 def provide_data(self):
12 return {
13- 'host': hookenv.unit_get('private-address'),
14- 'port': 80,
15+ 'host': hookenv.unit_get('hostname'),
16+ 'port': hookenv.unit_get('port'),
17 }
18
19

Subscribers

People subscribed via source and target branches