Merge lp:~verterok/charms/trusty/tanuki-spec-manager/service-name-for-website-relation into lp:~tanuki/charms/trusty/tanuki-spec-manager/trunk

Proposed by Guillermo Gonzalez
Status: Merged
Approved by: Guillermo Gonzalez
Approved revision: 34
Merged at revision: 32
Proposed branch: lp:~verterok/charms/trusty/tanuki-spec-manager/service-name-for-website-relation
Merge into: lp:~tanuki/charms/trusty/tanuki-spec-manager/trunk
Diff against target: 12 lines (+4/-0)
1 file modified
hooks/actions.py (+4/-0)
To merge this branch: bzr merge lp:~verterok/charms/trusty/tanuki-spec-manager/service-name-for-website-relation
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+274603@code.launchpad.net

Commit message

set service_name in website relation

Description of the change

set service_name in website relation

To post a comment you must log in.
33. By Guillermo Gonzalez

improve service-name split

34. By Guillermo Gonzalez

fix rsplit

Revision history for this message
Celso Providelo (cprov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/actions.py'
2--- hooks/actions.py 2015-10-05 14:39:08 +0000
3+++ hooks/actions.py 2015-10-15 18:29:56 +0000
4@@ -137,6 +137,10 @@
5 hookenv.log('Providing Website relation data.')
6 data = super(WebsiteRelation, self).provide_data()
7 data['port'] = 8000
8+ # unit name is in the form of: <service-name>-r<revno>
9+ # we need the service-name to match it with the haproxy services config
10+ service_name = hookenv.local_unit().rsplit("-r", 1)[0]
11+ data['service_name'] = service_name
12 return data
13
14

Subscribers

People subscribed via source and target branches