Merge lp:~cprov/charms/trusty/adt-image-mapper/bug-1409762 into lp:~canonical-ci-engineering/charms/trusty/adt-image-mapper/trunk

Proposed by Celso Providelo
Status: Merged
Approved by: Celso Providelo
Approved revision: 2
Merged at revision: 3
Proposed branch: lp:~cprov/charms/trusty/adt-image-mapper/bug-1409762
Merge into: lp:~canonical-ci-engineering/charms/trusty/adt-image-mapper/trunk
Diff against target: 44 lines (+16/-7)
2 files modified
hooks/actions.py (+15/-7)
hooks/services.py (+1/-0)
To merge this branch: bzr merge lp:~cprov/charms/trusty/adt-image-mapper/bug-1409762
Reviewer Review Type Date Requested Status
Para Siva (community) Approve
Review via email: mp+253148@code.launchpad.net

Commit message

Replicating workaround for bug #1409763 (blindly setting website relation via action, since RelationContext.provide_data is not working as expect).

Description of the change

Replicating workaround for bug #1409763 (blindly setting website relation via action, since RelationContext.provide_data is not working as expect).

To post a comment you must log in.
Revision history for this message
Para Siva (psivaa) wrote :

+1

review: Approve
Revision history for this message
Para Siva (psivaa) wrote :

(The bug id is bug #1409763 i suppose :))

Revision history for this message
Celso Providelo (cprov) wrote :

Psivaa,

Yes, got the bug number wrong in several places (branch name, commit message, MP description) ...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/actions.py'
--- hooks/actions.py 2015-03-13 16:53:41 +0000
+++ hooks/actions.py 2015-03-17 04:35:31 +0000
@@ -78,13 +78,21 @@
78 host.mkdir(LOG_DIR, WSGI_USER, WSGI_GROUP, perms=0755)78 host.mkdir(LOG_DIR, WSGI_USER, WSGI_GROUP, perms=0755)
7979
8080
81class WebsiteRelation(helpers.RelationContext):81def publish_website_relation_data(service_name):
82 name = 'website'82 # Due to Bug #1409763, this functionality is as action rather than the
83 interface = 'http'83 # provided_data below.
84 for relid in hookenv.relation_ids('website'):
85 hookenv.log(30 * '*')
86 hookenv.log('Hack for #1409763: {}'.format(relid))
87 hookenv.log(30 * '*')
88 hookenv.relation_set(
89 relid, host=hookenv.unit_get('private-address'), port=8000)
90
91
92class WebsiteRelation(helpers.HttpRelation):
8493
85 def provide_data(self):94 def provide_data(self):
86 data = {95 hookenv.log('Providing Website relation data.')
87 'hostname': hookenv.unit_private_ip(),96 data = super(WebsiteRelation, self).provide_data()
88 'port': 8000,97 data['port'] = 8000
89 }
90 return data98 return data
9199
=== modified file 'hooks/services.py'
--- hooks/services.py 2015-03-13 13:06:46 +0000
+++ hooks/services.py 2015-03-17 04:35:31 +0000
@@ -23,6 +23,7 @@
23 helpers.render_template(23 helpers.render_template(
24 source='upstart.conf',24 source='upstart.conf',
25 target='/etc/init/adt-image-mapper.conf'),25 target='/etc/init/adt-image-mapper.conf'),
26 actions.publish_website_relation_data,
26 actions.log_start,27 actions.log_start,
27 ],28 ],
28 },29 },

Subscribers

People subscribed via source and target branches